Part Number Hot Search : 
L75L05 MAX177 Q100S CPD109R SMCJ26 BTA92 TC531001 SA20C
Product Description
Full Text Search
 

To Download SDA6000 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  preliminary data sheet sda 6000 teletext decoder with embedded 16- b i t c o nt r oller edition march 1, 2001 6 2 51- 5 57-1 p d
for questions on technology, delivery and prices please contact the micronas offices in germany or the micronas gmbh companies and representatives worldwide: see our webpage at http://www.micronas.com sda 6000 revision history: current version: 2000-06-15 previous version: 08.99 page subjects (major changes since last revision) complete update of controller & peripheral spec --> detailed version asc: autobaud detection feature included ic: new description gpt: new description iic changed to i 2 c
contents overview
sda 6000 preliminary data sheet version 2.1 a-3 micronas 1overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 - 3 1.1 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 - 7 1.2 logic symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 - 9 2 pin descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 3 2.1 pin diagram (top view) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 3 2.2 pin definitions and functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 4 3 architectural overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 3 4 c16x microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 3 4.1 overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 3 4.2 memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 5 4.3 on-chip microcontroller ram and sfr area . . . . . . . . . . . . . . . . . . . . 4 - 7 4.3.1 system stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 9 4.3.2 general purpose registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 9 4.3.3 pec source and destination pointers . . . . . . . . . . . . . . . . . . . . . . . 4 - 10 4.3.4 special function registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 11 4.4 external memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 12 4.4.1 sdram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 13 4.4.2 external static memory devices . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 13 4.5 external bus interface (ebi). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 13 4.5.1 memory mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 16 4.5.2 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 19 4.5.3 crossing memory boundaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 23 4.6 central processing unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 24 4.6.1 instruction pipelining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 26 4.6.2 bit-handling and bit-protection . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 32 4.6.3 instruction state times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 33 4.6.4 cpu special function registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 34 5 interrupt and trap functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 3 5.1 interrupt system structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 3 5.1.1 interrupt allocation table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 4 5.1.2 hardware traps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 6 5.2 operation of the pec channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 13 5.2.1 prioritization of interrupt and pec service requests . . . . . . . . . . . 5 - 20 5.2.2 saving the status during interrupt service . . . . . . . . . . . . . . . . . . . 5 - 22 5.2.3 interrupt response times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 23 5.2.4 pec response times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 25 5.2.5 fast interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 27 5.3 trap functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 28 5.3.1 external interrupt source control . . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 33 6 system control & configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 3
sda 6000 preliminary data sheet version 2.1 a-4 micronas 6.1 system reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 3 6.1.1 behavior of i/os during reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 5 6.1.2 reset values for the controller core registers . . . . . . . . . . . . . . . . . 6 - 5 6.1.3 the internal ram after reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 5 6.2 system start-up configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 5 6.3 register write protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 8 6.4 power reduction modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 12 6.5 dedicated pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 15 6.6 xbus configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 17 6.7 watchdog timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 17 6.8 bootstrap loader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 21 6.9 identification registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 23 6.9.1 system identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 23 6.9.2 cpu identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 26 6.10 parallel ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 27 7 peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 3 7.1 general purpose timer unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 3 7.1.1 functional description of timer block 1 . . . . . . . . . . . . . . . . . . . . . . 7 - 3 7.1.1.1 timer concatenation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 14 7.1.2 functional description of timer block 2 . . . . . . . . . . . . . . . . . . . . . 7 - 19 7.1.2.1 core timer t6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 20 7.1.2.2 auxiliary timer t5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 21 7.1.2.3 timer concatenation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 22 7.1.3 gpt registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 26 7.1.4 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 37 7.2 real-time clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 39 7.2.1 general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 39 7.2.2 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 41 7.3 asynchronous/synchronous serial interface . . . . . . . . . . . . . . . . . . . . 7 - 46 7.3.1 asynchronous operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 49 7.3.1.1 asynchronous data frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 51 7.3.1.2 asynchronous transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 53 7.3.1.3 asynchronous reception . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 54 7.3.2 synchronous operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 56 7.3.2.1 synchronous transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 57 7.3.2.2 synchronous reception . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 58 7.3.2.3 synchronous timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 58 7.3.3 baud rate generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 59 7.3.3.1 baud rates in asynchronous mode . . . . . . . . . . . . . . . . . . . . . . 7 - 60 7.3.3.2 baud rates in synchronous mode . . . . . . . . . . . . . . . . . . . . . . . 7 - 63 7.3.4 autobaud detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 63 7.3.4.1 serial frames for autobaud detection . . . . . . . . . . . . . . . . . . . . . 7 - 64
sda 6000 preliminary data sheet version 2.1 a-5 micronas 7.3.4.2 baud rate selection and calculation . . . . . . . . . . . . . . . . . . . . . 7 - 67 7.3.4.3 overwriting registers on successful autobaud detection . . . . . 7 - 69 7.3.5 asc hardware error detection capabilities . . . . . . . . . . . . . . . . . . 7 - 70 7.3.6 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 71 7.3.7 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 72 7.4 high speed synchronous serial interface . . . . . . . . . . . . . . . . . . . . . . 7 - 82 7.4.1 full-duplex operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 86 7.4.2 half duplex operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 89 7.4.3 continuous transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 90 7.4.4 port control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 91 7.4.5 baud rate generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 91 7.4.6 error detection mechanisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 92 7.4.7 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 95 7.5 i2c-bus interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 99 7.5.1 operational overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 100 7.5.2 the physical i 2 c-bus interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 100 7.5.3 functional overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 103 7.5.4 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 105 7.6 analog digital converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 118 7.6.1 power down and wake up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 119 7.6.2 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 119 8 clock system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 - 3 8.1 general function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 - 3 8.2 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 - 4 9 sync system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 - 3 9.1 general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 - 3 9.1.1 screen resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 - 3 9.1.2 sync interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 - 5 9.2 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 - 6 10 display generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 3 10.1 general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 3 10.2 screen alignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 3 10.3 layer concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 5 10.3.1 overlapped layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 6 10.3.2 embedded layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 8 10.3.3 transparency in screen background area . . . . . . . . . . . . . . . . . . . 10 - 9 10.4 input and output formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 11 10.4.1 input formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 12 10.4.2 output formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 13 10.5 initialization of memory transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 17 10.5.1 transfer modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 17
sda 6000 preliminary data sheet version 2.1 a-6 micronas 10.5.2 transfer areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 20 10.5.3 italic mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 25 10.6 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 27 10.6.1 special function registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 27 10.7 description of graphic accelerator instructions . . . . . . . . . . . . . . . . . 10 - 30 10.7.1 screen attributes (sar) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 32 10.7.2 startaddress of layer 1 (fbr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 35 10.7.3 size of layer 1 (fsr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 35 10.7.4 startaddress of layer 2 (dbr) . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 36 10.7.5 size of layer 2 (dsr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 36 10.7.6 display coordinates of layer 2 (dcr) . . . . . . . . . . . . . . . . . . . . . 10 - 37 10.7.7 contents of clut (clr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 38 10.7.8 clipping coordinates (cur and cbr) . . . . . . . . . . . . . . . . . . . . . . 10 - 38 10.7.9 source descriptor for data transfer (sdr) . . . . . . . . . . . . . . . . . . 10 - 40 10.7.10 source size of transferred memory area (tsr) . . . . . . . . . . . . . . 10 - 41 10.7.11 destination size of transferred memory area (tdr) . . . . . . . . . . 10 - 42 10.7.12 offset of transferred memory area (tor) . . . . . . . . . . . . . . . . . . 10 - 43 10.7.13 attributes of transfer (tar) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 44 11 d/a converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 - 3 11.1 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 - 3 12 slicer and acquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 - 3 12.1 general function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 - 3 12.2 slicer architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 - 3 12.2.1 distortion processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 - 5 12.2.2 data separation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 - 6 12.3 h/v-synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 - 6 12.4 acquisition interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 - 6 12.4.1 fc-check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 - 7 12.4.2 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 - 8 12.4.3 vbi buffer and memory organization . . . . . . . . . . . . . . . . . . . . . . . 12 - 8 12.5 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 - 9 12.5.1 ram registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 - 12 12.5.2 recommended parameter settings . . . . . . . . . . . . . . . . . . . . . . . . 12 - 25 13 register overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 - 3 13.1 register description format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 - 3 13.2 cpu general purpose registers (gprs) . . . . . . . . . . . . . . . . . . . . . 13 - 4 13.3 registers ordered by context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 - 5 13.4 registers ordered by address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 - 13 13.4.1 registers in sfr area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 - 14 13.4.2 registers in esfr area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 - 15 14 electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 - 3
sda 6000 preliminary data sheet version 2.1 a-7 micronas 14.1 absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 - 3 14.2 operating range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 - 3 14.3 dc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 - 4 14.4 timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 - 10 14.5 package outlines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 - 11
sda 6000 preliminary data sheet version 2.1 b-1 micronas figure 1-1 m2 tool flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 - 5 figure 1-2 logic symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 - 9 figure 2-1 pin configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 3 figure 3-1 m2 top level block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 3 figure 4-1 m2 memory path block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 6 figure 4-2 storage of words, byte and bits in a byte organized memory . . . . 4 - 7 figure 4-3 internal ram areas and sfr areas . . . . . . . . . . . . . . . . . . . . . . . . 4 - 8 figure 4-4 location of the pec pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 11 figure 4-5 external memory configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 14 figure 4-6 interlocked access cycles to rom and sdram. . . . . . . . . . . . . . 4 - 15 figure 4-7 interlocked access cycles to two sdram banks . . . . . . . . . . . . . 4 - 16 figure 4-8 memory mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 17 figure 4-9 four-phase handshake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 21 figure 4-10 cpu block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 25 figure 4-11 sequential instruction pipelining . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 28 figure 4-12 standard branch instruction pipelining . . . . . . . . . . . . . . . . . . . . . 4 - 28 figure 4-13 cache jump instruction pipelining. . . . . . . . . . . . . . . . . . . . . . . . . 4 - 29 figure 4-14 addressing via the code segment pointer . . . . . . . . . . . . . . . . . . 4 - 42 figure 4-15 addressing via the data page pointers . . . . . . . . . . . . . . . . . . . . . 4 - 44 figure 4-16 register bank selection via register cp. . . . . . . . . . . . . . . . . . . . 4 - 45 figure 4-17 implicit cp use by short gpr addressing modes . . . . . . . . . . . . 4 - 46 figure 5-1 priority levels and pec channels . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 10 figure 5-2 mapping of pec offset pointers into the internal ram . . . . . . . . . 5 - 19 figure 5-3 task status saved on the system stack . . . . . . . . . . . . . . . . . . . . 5 - 22 figure 5-4 pipeline diagram for interrupt response time . . . . . . . . . . . . . . . 5 - 23 figure 5-5 pipeline diagram for pec response time . . . . . . . . . . . . . . . . . . 5 - 26 figure 6-1 state machine for security level switching . . . . . . . . . . . . . . . . . . 6 - 11 figure 6-2 transitions between idle mode and active mode . . . . . . . . . . . . . 6 - 14 figure 6-3 wdt block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 18 figure 6-4 bootstrap loader sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 22 figure 6-5 portlogic register overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 - 27 figure 7-1 structure of timer block 1 core timer t3 . . . . . . . . . . . . . . . . . . . . 7 - 4 figure 7-2 block diagram of core timer t3 in timer mode . . . . . . . . . . . . . . . 7 - 7 figure 7-3 block diagram of core timer t3 in gated timer mode. . . . . . . . . . 7 - 7 figure 7-4 block diagram of core timer t3 in counter mode . . . . . . . . . . . . . 7 - 8 figure 7-5 block diagram of core timer t3 in incremental interface mode . . . 7 - 9 figure 7-6 interfacing the encoder to the microcontroller . . . . . . . . . . . . . . . . 7 - 10 figure 7-7 evaluation of the incremental encoder signals . . . . . . . . . . . . . . . 7 - 11 figure 7-8 evaluation of the incremental encoder signals . . . . . . . . . . . . . . . 7 - 12 figure 7-9 block diagram of an auxiliary timer in counter mode . . . . . . . . . 7 - 13 figure 7-10 concatenation of core timer t3 and an auxiliary timer . . . . . . . . 7 - 15 figure 7-11 gpt1 auxiliary timer in reload mode. . . . . . . . . . . . . . . . . . . . . . 7 - 16 figure 7-12 gpt1 timer reload configuration for pwm generation . . . . . . . . 7 - 17
sda 6000 preliminary data sheet version 2.1 b-2 micronas figure 7-13 auxiliary timer of timer block 1 in capture mode. . . . . . . . . . . . . 7 - 18 figure 7-14 structure of timer block 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 19 figure 7-15 block diagram of core timer t6 in timer mode . . . . . . . . . . . . . . 7 - 21 figure 7-16 concatenation of core timer t6 and auxiliary timer t5. . . . . . . . 7 - 22 figure 7-17 timer block 2 register caprel in capture mode . . . . . . . . . . . . 7 - 23 figure 7-18 timer block 2 register caprel in reload mode . . . . . . . . . . . . . 7 - 24 figure 7-19 timer block 2 register caprel in capture-and-reload mode . . 7 - 25 figure 7-20 rtc register overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 39 figure 7-21 rtc block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 40 figure 7-22 block diagram of the asc0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 47 figure 7-23 asc register overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 48 figure 7-24 asynchronous mode of serial channel asc0 . . . . . . . . . . . . . . . . 7 - 50 figure 7-25 asynchronous 8-bit frames. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 51 figure 7-26 asynchronous 9-bit frames. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 52 figure 7-27 irda frame encoding/decoding . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 53 figure 7-28 fixed irda pulse generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 55 figure 7-29 rxd/txd data path in asynchronous modes . . . . . . . . . . . . . . . . 7 - 56 figure 7-30 synchronous mode of serial channel asc0 . . . . . . . . . . . . . . . . . 7 - 57 figure 7-31 asc0 synchronous mode waveforms . . . . . . . . . . . . . . . . . . . . . 7 - 59 figure 7-32 asc0 baud rate generator circuitry in asynchronous modes . . . 7 - 61 figure 7-33 asc0 baud rate generator circuitry in synchronous mode . . . . 7 - 63 figure 7-34 asc_p3 asynchronous mode block diagram . . . . . . . . . . . . . . . . 7 - 64 figure 7-35 two-byte serial frames with ascii ?at? . . . . . . . . . . . . . . . . . . . . . 7 - 65 figure 7-36 two-byte serial frames with ascii ?at? . . . . . . . . . . . . . . . . . . . . 7 - 66 figure 7-37 asc0 interrupt generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 72 figure 7-38 sfrs and port pins associated with the ssc0 . . . . . . . . . . . . . . . 7 - 83 figure 7-39 synchronous serial channel ssc0 block diagram. . . . . . . . . . . . 7 - 84 figure 7-40 serial clock phase and polarity options . . . . . . . . . . . . . . . . . . . . 7 - 86 figure 7-41 ssc0 full duplex configuration . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 87 figure 7-42 ssc half duplex configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 90 figure 7-43 ssc0 baud rate generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 91 figure 7-44 ssc0 error interrupt control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 93 figure 7-45 i 2 c bus line connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 - 100 figure 7-46 physical bus configuration example . . . . . . . . . . . . . . . . . . . . . . 7 - 102 figure 7-47 sfrs and port pins associated with the a/d converter . . . . . . . 7 - 118 figure 8-1 clock system in m2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 - 3 figure 9-1 m2?s display timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 - 4 figure 9-2 priority of clamp phase, screen background and pixel layer area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 - 11 figure 10-1 display regions and alignments . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 4
sda 6000 preliminary data sheet version 2.1 b-3 micronas figure 10-2 behavior of blank pin for consecutive frames in ? meshed ? regions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 5 figure 10-3 priority of layers in overlapped layer mode. . . . . . . . . . . . . . . . . 10 - 6 figure 10-4 priority of layers in embedded layer mode . . . . . . . . . . . . . . . . . 10 - 9 figure 10-5 format of 1-bitplane bitmap. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 12 figure 10-6 format of 2-bitplane bitmap. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 12 figure 10-7 format of 4-bitplane bitmap. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 12 figure 10-8 format of 8-bitplane bitmap. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 13 figure 10-9 overview on sru . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 13 figure 10-10 2-bit pixel format for use in frame buffer . . . . . . . . . . . . . . . . . 10 - 14 figure 10-11 8-bit pixel format for use in frame buffer . . . . . . . . . . . . . . . . . 10 - 14 figure 10-12 16-bit pixel format (4:4:4:2/ttx) for use in frame buffer . . . . . 10 - 15 figure 10-13 internally generated flash signals in different flash phases. . . 10 - 16 figure 10-14 16-bit pixel format (5:6:5) for use in frame buffer . . . . . . . . . . . 10 - 16 figure 10-15 overview of ga . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 17 figure 10-16 use of register settings to specify source area . . . . . . . . . . . . 10 - 22 figure 10-17 use of register settings to specify destination and clipping area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 25 figure 10-18 result for a non-italic transferred memory area in frame buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 25 figure 10-19 result for a italic transferred memory area in frame buffer . . . 10 - 26 figure 10-20 result for an italic transferred memory area at d/a converter output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 26 figure 10-21 organization of gais in the external sdram . . . . . . . . . . . . . . . 10 - 30 figure 10-22 gai instruction format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 31 figure 12-1 block diagram of digital slicer and acquisition interface . . . . . . . 12 - 4 figure 12-2 vbi buffer: general structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 - 9 figure 14-1 h/v - sync-timing (sync-master mode) . . . . . . . . . . . . . . . . . . . 14 - 10 figure 14-2 vcs -timing (sync-master mode) . . . . . . . . . . . . . . . . . . . . . . . . 14 - 10
sda 6000 preliminary data sheet version 2.1 c-1 micronas preface m2 is a 16-bit controller based on infineon ? s c16x core with embedded teletext and graphic controller functions. m2 can be used for a wide range of tv and osd applications. this document provides complete reference information on the hardware of m2. organization of this document this users manual is divided into 14 chapters. it is organized as follows:  chapter 1, overview gives a general description of the product and lists the key features.  chapter 2, pin description lists pin locations with associated signals, categorizes signals according to function, and describes signals.  chapter 3, architectural overview gives an overview on the hardware architecture and explains the dataflow within m2.  chapter 4, c16x microcontroller gives a detailed explanation of the 16-bit c architecture.  chapter 5, interrupt and trap functions, explains the powerful c166 interrupt facilities.  chapter 6, system control & configuration describes how to configure and control the complete c system and the power management unit.  chapter 7, peripherals describes the peripherals (serial buses and timers modules) of the micro.  chapter 8 & 9, clock system & sync system describes how clocks & syncs for the display generator are generated.  chapter 10 & 11, display generator and d/a converter explains the architecture and programming possibilities of the unit which generates the rgb signals.  chapter 12, acquisition and slicer describes features and functionality of the data caption unit.  chapter 13, register overview summarizes all hw-registers of m2.  chapter 14, electrical characteristics lists all important ac and dc values and the maximum operating conditions of m2.
sda 6000 preliminary data sheet version 2.1 c-2 micronas related documentation for easier understanding of this specification it is recommended to read the documentation listed in the following table. moreover it gives an overview of the software drivers which are available for m2. document name document purpose appl. note ? initialization and bootstraploader of m2 ? system integration support
sda 6000 preliminary data sheet version 2.1 overview 1 - 3 micronas 1overview m2 is designed to provide absolute top performance for a wide spectrum of teletext and graphic applications in standard and high end tv-sets and vcrs. m2 contains a data caption unit, a display unit and a high performance infineon c16x based microcontroller (so that m2 becomes a one chip tv-controller) an up to level 3.5 teletext decoder and display processor with enhanced graphic accelerator capabilities. it is not only optimized for teletext usage but also, due to its extremely efficient architecture, can be used as a universal graphic engine. m2 is able to support a wide range of standards like pal, ntsc or applications like teletext, vps, wss, chinatext, closed caption and epg (electronic program guide). with the support of a huge number of variable character sets and graphic capabilities a wide range of osd applications are also open for m2. a new flexible data caption system enables m2 to slice most data, making the ic an universal data decoder. the digital slicer concept contains measurement circuitries that help identify bad signal conditions and therefore support the automatic compensation of the most common signal disturbances. m2 ? s enhanced data caption control logic allows individual programming, which means that every line can carry an individual service to be sliced and stored in the memory. the display generation of m2 is based on frame buffer technology. a frame buffer concept displays information which is individually stored for each pixel, allowing greater flexibility with screen menus. proportional fonts, asian characters and even html browsers are just some examples of applications that can now be supported. thus, with the m2, the process of generation and display of on-screen graphics is split up into two independent tasks. the generation of the image in the frame buffer is supported by a hardware graphics accelerator which frees the cpu from power intensive address calculations. the graphics accelerator ? prints ? the characters, at the desired ? screen ? position, into the frame buffer memory based on a display list provided by the software. the second part of the display generator (the screen refresh unit) then reads the frame buffer according to the programmed display mode and screen refresh rate and converts the pixel information into an analog rgb signal. furthermore, m2 has implemented an rgb-dac for a maximum color resolution of state-of-the-art up to 65536 colors, so that the complete graphic functionality is implemented as a system on chip. the screen resolution is programmable up to svga, to cover today ? s and tomorrow ? s applications, only limited by the available memory (64 mbit) and the maximum pixel clock frequency (50 mhz). the memory architecture is based on the concept of a unified memory - placing program code, variables, application data, bitmaps and data captured from the analog tv signal ? s vertical blanking interval (vbi) in the same physical memory. m2 ? s external bus interface
sda 6000 preliminary data sheet version 2.1 overview 1 - 4 micronas supports sdrams as well as roms or flash roms. the organization of the memory is linear, so that it is easy to program the chip for graphic purposes. the sw development environment ? mate ? is available to simplify and speed up the development of the software and displayed information. mate stands for: m 2 a dvanced t ool e nvironment. using mate, two primary goals are achieved: shorter time-to-market and improved sw qualitiy. in detail:  re-usability  target independent development  verification and validation before targeting  general test concept  documentation  graphical interface design for non-programmers  modular and open tool chain, configurable by customer m a te us e s av a i l ab l e c 1 66 m i c r oco n t r o l l e r f a m i l y s t and a r d t oo l s as w e ll as a dedicated m2 tools.
sda 6000 preliminary data sheet version 2.1 overview 1 - 5 micronas figure 1-1 m2 tool flow m2 - the 16 bit mc, ttx/epg/teleweb, high end osd engine linker/locator embedded system m2 rtos pc simulator + eva board c166-available debugging ueb11114 object library manager info m2 formatted data, converter display data object code c compiler new tool generation simulator user interface dedicated m2 libraries object editor user interface c sources generator c code events and action editor sie-mate tool concept: fast prototyping on the pc
sda 6000 preliminary data sheet version 2.1 overview 1 - 6 micronas standard tool chain for the m2 software development (documentation, coding, debugging and test) the infineon c166 microcontroller family standard tools can be used: these are ascii editor, structogram editor, compiler, assembler, linker. debugging is supported by low-priced rom-monitor debuggers or the ocds (on chip debug support) debugger. m2 dedicated tools special tools are primarily available for platform independent m2 software development and secondly to generate data and control code for the m2 graphical user interface (gdi) without having knowledge of m2 hardware. these are:  display generator simulator  teletext data slicer simulator  gdi (graphical device interface)  teletext decoder and display software for level 1.5 and level 2.5  mate display builder for management, editing, handling and generation of all necessary data to display osd ? s  evaluation board simulator to connect a c166 eva board to the m2 simulation the m2 software is written in ansi-c to fulfil the platform independent development. the ported software is code and runtime optimized. the layers of the modular architecture are separated by application program interfaces which ensure independent handling of the modules.
1 - 7 micronas type package sda 6000 p-mqfp-128-2 teletext decoder with embedded 16-bit controller m2 version 2.1 cmos p-mqfp-128-2 sda 6000 preliminary data sheet version 2.1 overview 1.1 features general  level 1.5, 2.5, 3.5 wst display compatible  fast external bus interface for sdram (up to 8 mbyte) and rom or flash-rom (up to 4 mbyte)  embedded general purpose 16 bit cpu (also used as tv-system controller, c16x compatible)  display generation based on pixel memory  program code also executable from external sdram  embedded refresh controller for external sdram  enhanced programmable low power modes  single 6 mhz crystal oscillator  multinorm h/v-display synchronization in master or slave mode  free programmable pixel clock from 10 mhz to 50 mhz  pixel clock independent from cpu clock  3 ? 6 bits rgb-dacs on-chip  supply voltage 2.5 and 3.3 v  p-mqfp-128 package microcontroller features  16-bit c166-cpu kernel (c16x compatible)  60 ns instruction cycle time  2 kbytes dual ported iram  2 kbytes xram on-chip  general purpose timer units (gpt1 and gpt2).  asynchronous/synchronous serial interface (asc0) with irda support. full-duplex asynchronous up to 2 mbaud or half-duplex synchronous up to 4.1 mbaud.
sda 6000 preliminary data sheet version 2.1 overview 1 - 8 micronas  high-speed synchronous serial interface (ssc). full- and half-duplex synchronous up to 16.5 mbaud  3 independent, hw-supported multi master/slave i 2 c channels at 400 kbit/s  16-bit watchdog timer (wdt)  real time clock (rtc)  on chip debug support (ocds)  4-channel 8-bit a/d converter  42 multiple purpose ports  8 external interrupts  33 interrupt nodes display features  osd size from 0 to 2046 (0 to 1023) pixels in horizontal (vertical) direction  frame buffer based display  2 hw display layers  support of double page level 2.5 ttx in 100 hz systems  support of transparency for both layers pixel by pixel  user programmable pixel frequency from 10.0 mhz to 50 mhz  up to 65536 displayable colors in one frame  dma functionality  graphic accelerator functions (draw lines, draw and fill rectangle, etc.)  1, 2, 4 or 8-bit bitmaps (up to 256 out of 4096 colors)  12 bit/16 bit rgb mode for display of up to 65535 colors  hw-support for proportional characters  hw-support for italic characters  user definable character fonts  fast blanking and contrast reduction output acquisition features  two independent data slicers (one multistandard slicer + one wss-only slicer)  parallel multi-norm slicing (ttx, vps, wss, cc, g+)  four different framing codes available  data caption only limited by available memory  programmable vbi-buffer  full channel data slicing supported  fully digital signal processing  noise measurement and controlled noise compensation  attenuation measurement and compensation  group delay measurement and compensation  exact decoding of echo disturbed signals
sda 6000 preliminary data sheet version 2.1 overview 1 - 9 micronas 1.2 logic symbol figure 1-2 logic symbol uel11115 ss v dd(3.3 v) v xtal1 address 16 bit xtal2 rstin cvbs1a cvbs1b cvbs2 r g b cor blank hsync vsync rd wr csrom cssdram memclk udqm ldqm clken 16 bit data port 2 8 bit 15 bit port 3 6 bit port 4 6 bit port 5 7 bit port 6 4 bit jtag ss v dd(2.5 v) v m2
pin description
sda 6000 preliminary data sheet version 2.1 pin descriptions 2 - 3 micronas 2 pin descriptions
sda 6000 preliminary data sheet version 2.1 pin descriptions 2 - 4 micronas 2.1 pin diagram (top view) figure 2-1 pin configuration m2 v dd33-2 uep11116 p5.3 a3 tmode a4 tms d2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 128 127 34 126 35 125 36 124 37 123 38 122 39 121 40 120 41 119 42 118 117 44 116 45 115 46 114 47 113 48 112 49 111 50 110 51 109 52 108 107 54 106 55 105 56 104 57 103 58 102 59 101 60 100 61 99 62 98 97 64 96 95 94 93 92 91 90 89 88 87 86 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 33 63 53 43 v ss33-3 v ss33-6 v dda-4 85 tck tdi tdo p2.8 p2.9 p2.10 p2.11 p2.12 p2.13 p2.14 p2.15 v ss33-1 dd33-1 v p4.5/cs3 p4.4/a20 p4.3/a19 p4.2/a18 p4.1/a17 ss25-1 v dd25-1 v p4.0/a16 a8 a7 a6 a5 a10 a11 a12 a9 v ss33-2 a2 a1 a0 a13 a14/ras a15/cas dd33-3 v memclk cssdram clken csrom rd udqm ldqm wr d15 ss33-4 v dd33-4 v d7 d0 d14 d8 d6 d1 ss33-5 v dd33-5 v d5 d9 d13 d12 d10 v dd33-6 d4 d3 d11 rstin p3.0 p3.1 p3.2 p3.3 p3.4 p3.5 p3.6 p3.7 p3.8 p3.9 v ss33-7 dd33-7 v ss25-2 v dd25-2 v p3.10 p3.11 p3.12 p3.13 p3.15 p5.14 p5.15 p6.0 p6.1 p5.2 p5.1 p5.0 ssa-4 v cvbs1a cvbs1b dda-3 v ssa-3 v cvbs2 dda-2 v ssa-2 v b g r dda-1 v ssa-1 v xtal2 xtal1 ss33-8 v dd33-8 v blank/corbla cor/rstout hsync vsync p6.6 p6.5 p6.4 p6.3 p6.2 p-mqfp-128-2 p-mqfp-128-2
sda 6000 preliminary data sheet version 2.1 pin descriptions 2 - 5 micronas 2.2 pin definitions and functions table 2-1 pin definition and functions pin no. pin name second function dir. function 37 a0 r0/c0 o address bit (all addresses are word addresses)/sdram address bit 36 a1 r1/c1 o address bit/sdram address bit 35 a2 r2/c2 o address bit/sdram address bit 34 a3 r3/c3 o address bit/sdram address bit 33 a4 r4/c4 o address bit/sdram address bit 27 a5 r5/c5 o address bit/sdram address bit 26 a6 r6/c6 o address bit/sdram address bit 24 a7 r7/c7 o address bit/sdram address bit 23 a8 r8 o address bit/sdram address bit 25 a9 r9 o address bit/sdram address bit 28 a10 r10 o address bit/sdram address bit 29 a11 r11 o address bit/sdram address bit 30 a12 r12 o address bit/sdram address bit 38 a13 r13 o address bit/sdram address bit 39 a14 ras o address bit/ row address strobe for sdram access 40 a15 cas o address bit/ column address strobe for sdram access 55 d0 ? i/o data bit 59 d1 ? i/o data bit 65 d2 ? i/o data bit 71 d3 ? i/o data bit 70 d4 ? i/o data bit 64 d5 ? i/o data bit 58 d6 ? i/o data bit 54 d7 ? i/o data bit 57 d8 ? i/o data bit 63 d9 ? i/o data bit
sda 6000 preliminary data sheet version 2.1 pin descriptions 2 - 6 micronas 67 d10 ? i/o data bit 72 d11 ? i/o data bit 66 d12 ? i/o data bit 62 d13 ? i/o data bit 56 d14 ? i/o data bit 51 d15 ? i/o data bit 47 rd ? o external memory read strobe for rom. rd is activated for every external instruction or data read access. 46 csrom ? o chip select signal for rom device 44 cssdram ? o chip select signal for sdram device 43 memclk ? o clock for sdram 45 clken ? o enable for memory clock 50 wr ? o memory write strobe 22 p4.0 a16 o general purpose output port/address bit 19 p4.1 a17 o general purpose output port/address bit 18 p4.2 a18 o general purpose output port/address bit 17 p4.3 a19 o general purpose output port/address bit 16 p4.4 a20 o general purpose output port/address bit 15 p4.5 cs3 o general purpose output port/chip select signal for second external static memory 49 ldqm ? o write disable for low byte 48 udqm ? o write disable for high byte 109 xtal2 ? o output of the oscillator amplifier circuit 108 xtal1 ? i input of the oscillator amplifier circuit 73 rstin ? i reset input pin 121 cvbs1a ? i cvbs signal inputs for full service data slicing 120 cvbs1b ? i ground for cvbs1a (differential input) 117 cvbs2 ? i cvbs signal inputs for wss data slicing 112 r ? o analog output for red channel table 2-1 pin definition and functions (cont ? d) pin no. pin name second function dir. function
sda 6000 preliminary data sheet version 2.1 pin descriptions 2 - 7 micronas 113 g ? o analog output for green channel 114 b ? o analog output for blue channel 104 cor rstout o output for contrast reduction/reset output 105 blank corbla o fast blanking signal/three-level signal for contrast reduction + fast blanking 103 hsync ? i/o horizontal sync in/output 102 vsync vcs i/o vertical sync in/output/composite sync output 5 p2.8 ex0in i/o general purpose i/o port/external interrupt 0 6 p2.9 ex1in i/o general purpose i/o port/external interrupt 1 7 p2.10 ex2in i/o general purpose i/o port/external interrupt 2 8 p2.11 ex3in i/o general purpose i/o port/external interrupt 3 9 p2.12 ex4in i/o general purpose i/o port/external interrupt 4 10 p2.13 ex5in i/o general purpose i/o port/external interrupt 5 11 p2.14 ex6in i/o general purpose i/o port/external interrupt 6 12 p2.15 ex7in i/o general purpose i/o port/external interrupt 7 74 p3.0 scl0 i/o general purpose i/o port/i 2 c bus clock line 0 75 p3.1 sda0 i/o general purpose i/o port/i 2 c bus data line 0 76 p3.2 capin i/o general purpose i/o port/gpt2 register caprel 77 p3.3 t3out i/o general purpose i/o port/gpt1 timer t3 toggle 78 p3.4 t3eud i/o general purpose i/o port/gpt1 timer t3 ext. up/down 79 p3.5 t4in i/o general purpose i/o port/gpt1 timer t4 input for count/gate/reload/capture 80 p3.6 t3in i/o general purpose i/o port/gpt1 timer t3 count/gate input 81 p3.7 t2in i/o general purpose i/o port/gpt1 timer t2 input for count/gate/reload/capture 82 p3.8 mrst i/o general purpose i/o port/ssc master- receiver/slave-transmit i/o table 2-1 pin definition and functions (cont ? d) pin no. pin name second function dir. function
sda 6000 preliminary data sheet version 2.1 pin descriptions 2 - 8 micronas 83 p3.9 mtsr i/o general purpose i/o port/ssc master- transmit/slave-receiver o/i 88 p3.10 txd0 i/o general purpose i/o port/asc0 clock/data output 89 p3.11 rxd0 i/o general purpose i/o port/asc0 data input (asynchronous) or i/o (synchronous.) 90 p3.12 ? i/o general purpose i/o port 91 p3.13 sclk i/o general purpose i/o port/ssc master clock output/slave clock input 92 p3.15 ? i/o general purpose i/o port 124 p5.0 an.0 i general purpose i/o port/analog input for a/d-converter 125 p5.1 an.1 i general purpose i/o port/analog input for a/d-converter 126 p5.2 an.2 i general purpose i/o port/analog input for a/d-converter 127 p5.3 an.3 i general purpose i/o port/analog input for a/d-converter 93 p5.14 t4eud i/o general purpose i/o port/gpt1 timer t4 ext.up/down ctrl. input 94 p5.15 t2eud i/o general purpose i/o port/gpt1 timer t2 ext.up/down ctrl. input 95 p6.0 trig_in i/o general purpose i/o port/trigger input-signal for ? on chip debug system ? (ocds) 96 p6.1 trig_out i/o general purpose i/o port/trigger output- signal for ? on chip debug system ? (ocds) 97 p6.2 ? i/o general purpose i/o port 98 p6.3 scl1 i/o general purpose i/o port/i 2 c bus clock line 1 99 p6.4 sda1 i/o general purpose i/o port/i 2 c bus data line 1 100 p6.5 ? i/o general purpose i/o port 101 p6.6 sda2 i/o general purpose i/o port/i 2 c bus data line 2 1tck ? i clock for jtag interface 3tdi ? i data input for jtag interface table 2-1 pin definition and functions (cont ? d) pin no. pin name second function dir. function
sda 6000 preliminary data sheet version 2.1 pin descriptions 2 - 9 micronas 4tdo ? o data output for jtag interface 2tms ? i control signal for jtag interface 128 tmode ? i testmode pin 1) 110 v ssa-1 ? s analog ground 111 v dda-1 ? s analog power (for pll and dac) (2.5 v) 115, 118, 122 v ssa2-4 ? s analog ground 116, 119, 123 v dda2-4 ? s analog power (for adcs) (2.5 v) 20, 86 v ss25 1-2 ? s digital ground (for digital core) 21, 87 v dd25 1-2 ? s digital power (for digital core) (2.5 v) 13, 31, 41, 52, 60, 68, 84, 107 v ss33 1-8 ? s digital ground for pads 14, 32, 42, 53, 61, 69, 85, 106 v dd33 1-8 ? s digital power (for pads) (3.3 v) 1) (must be kept to ? 0 ? in application.) table 2-1 pin definition and functions (cont ? d) pin no. pin name second function dir. function
architectural overview
sda 6000 preliminary data sheet version 2.1 architectural overview 3 - 3 micronas 3 architectural overview figure 3-1 m2 top level block diagram ueb10716 4- channel adc 7-bit usart asc ssc spi gpt1 t2 t3 t4 gpt2 t5 t6 2 c rtc watchdog ocds jtag port 5 port 3 port 2 port 4 6 15 8 8 d-sync 3 3 x 6 bit dac fifo sru ga xram interrupt controller pec 36 nodes (8 ext.) osc (6 mhz) internal ram 2 kbyte 16 16 data data instr./data 32 -cache d-cache 16 x-bus instr./data interface external bus 16 slicer2 slicer1 acq 16 data 16...21 addr. cvbs2 cpu-core c166 16 16 cvbs1 hv rom boot port 6 7 4 2 kbyte xtal ami
sda 6000 preliminary data sheet version 2.1 architectural overview 3 - 4 micronas the architecture of m2 comprises of a 16-bit microcontroller which is derived from the well known infineon technologies c16x controller family. due to the core philosophy of m2, the architecture of the cpu core is the same as described in other infineon technologies c16x derivatives. the cpu, with its peripherals, can be used on one hand to perform all tv controlling tasks, and on the other hand to process the data, sliced by the slicer, and the acquisition unit according to the ttx standard. furthermore it is used to generate an ? instruction list ? for the graphic accelerator which supports the cpu by generating the display. m2 has integrated two digital slicers for two independent cvbs signals. one slicer is used to capture the data (e.g. teletext or epg) from the main channel, the other slicer can be used to slice the wss information from a different channel, which is helpful e.g. to support pip applications in 16:9 tvs. both slicers separate the data from the analog signal and perform the bit synchronization and framing code selection before the data is stored in a programmable vbi buffer in the external ram. capturing and storing the raw data in the ram does not need any cpu power. m2 ? s display concept has improved in comparison to the common known state of the art teletext-ics. the display concept is based on a pixel orientated attribute definition instead of the former character orientated attribute definition. for the processing of this new pixel based attribute definition the display generator architecture is divided in two subblocks: the graphic accelerator (ga) and the screen refresh unit (sru). the graphic accelerator is used to modify the frame buffer. from an abstract point of view, the graphic accelerator is a dma which is optimized for osd functionality, so e.g. bitmaps can be copied to the frame buffer. the graphic accelerator is used to draw rectangles, parallelograms, horizontal, vertical and diagonal lines. the user does not need to access the graphic accelerator directly, thanks to an easy to handle sw-gdi function which is available with the m2 hardware. the dma functionality of the display generator (dg) supports the pixel transfer between any address of entire external memory. the teletext and graphic capabilities can be used simultaneously, so that m2 can combine teletext information with e.g. background images and advanced high resolution osd graphics. m2 uses the frame buffer located in external memory so every bitmap can be placed at any location on the screen. the contents of the frame buffer does not have to be set up in real time. the duration of the set up of the screen depends on the contents of the displayed information. m2 supports two hardware display layers. to refresh the screen the m2 reads and mixes two independent pixel sources simultaneously. different formats of the pixels which are part of different applications (e.g. teletext formats, 12-bit rgb or 16-bit rgb values) can be stored in the same frame buffer at the same time.
sda 6000 preliminary data sheet version 2.1 architectural overview 3 - 5 micronas the screen refresh unit is used to read the frame buffer pixel by pixel in real time and to process the transparency and rgb data. a color look up table (clut) can be used to get the rgb data of the current pixel. afterwards the rgb data is transferred to the d/a converter. the blank signal and contrast reduction signal (cor) is also processed for each pixel by the sru and transferred to the corresponding output pins. the pixel, line and field frequencies are widely programmable so that the sync system can be used from low end 50 hz to high end 100 hz tv applications as well as for any other standard. the on chip clock system provides the m2 with its basic clock signals. independent clock domains are provided for the embedded controller, the bus interface and the display system. the pixel clock can vary between 10 mhz and 50 mhz. due to the unified memory architecture of m2, a new bus concept is implemented. an arbiter handles the bus requests from the different request sources. these are:  slicer 1 requests (normally used as a ttx slicer)  slicer 2 requests (used as a wss slicer)  graphic accelerator requests  screen refresh unit requests  data requests from the cpu via xbus  instruction requests via the cpu program bus for exploiting the full computational power of the controller core the code of time critical routines can be stored in one bank of the external sdram separated from all display information (frame buffer, character set etc.). an instruction cache (i-cache) is used for buffering instruction words in order to minimize the probability of wait states to occur when the microcontroller is interfering with the display generator (dg) for access rights to the external memory devices. the data cache (d-cache) serves for operand reads and writes via the xbus from/to external memory devices. the external bus interface (ebi) features interleaved access cycles to one or two static external memory devices (rom, flash-rom or sram) with a total maximum size of 4 mbyte and one pc100 compliant (intel standard) sdram device (16 mbit organized as 2 memory banks or 64 mbit organized as 4 memory banks). for tv controlling tasks m2 provides three serial interfaces (i 2 c, asc, ssc), two general purpose timers, (gpt1, gpt2), a real time clock (rtc), a watch dog timer (wdt), an a/ d converter and eight external interrupts.
c16x microcontroller
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 3 micronas 4 c16x microcontroller
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 4 micronas 4.1 overview m2 ? s microcontroller and its peripherals are based on a cell-based core ( cbc ) which is compatible to the well known c166 architecture. in m2, the cpu and its peripherals are generally clocked with 33.33 mhz which results in an instruction cycle time of 60 ns. the implementation of the microcontroller within m2 deviates from other known c16x derivates since the controller ? s xbus is not used as the external bus. all external access cycles of the microcontroller, the display generator and the acquisition unit are performed via a high performance time interlocking sdram bus. the external bus interface (ebi) manages the arbitration procedure for access cycles to the external synchronous dram in parallel to an external static memory (rom or flash; for more details refer to chapter 4.4 ). due to the realtime critical bus bandwidth requirements of the display generator, unpredictable wait-states for the controller may occur. these wait-states do not destroy the overall average system performance, because they are mostly buffered by the cpu related instruction and data buffers. nevertheless they can influence, for example, the worst disconnection response time. emulation is now performed by an on-chip debug module which can be accessed by a jtag interface. the following microcontroller peripherals are implemented:  2 kbyte iram (system ram)  2 kbyte xram (xbus located)  32 interrupt nodes  general purpose timer units (gpt1 and gpt2)  real time clock (rtc)  asynchronous/synchronous serial interface (asc0)  high-speed synchronous serial interface (ssc)  i 2 c bus interface (i 2 c)  4-channel 8-bit a/d converter (adc)  watchdog timer (wdt)  on-chip debug support module (ocds)  42 multiple purpose ports central processing unit the cpu executes the c166 instruction set (with the extensions of the c167 products). its main features are the following:  4-stage pipeline (fetch, decode, execute and write-back).  16 ? 16-bit general purpose registers  16-bit arithmetic and logic unit  barrel shifter  bit processing capability
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 5 micronas  hardware support for multiply and divide instructions internal ram (iram) the internal dual-port ram is the physical support for the general purpose registers, the system stack and the pec pointers. due to its close connections with the cpu, the internal ram provides fast access to these resources. as the gpr bank can be mapped anywhere in the internal ram through a base pointer (context pointer cp), fast context switching is allowed. the internal ram is mapped in the memory space of the cpu and can be used also to store user variables or code. interrupt controller up to 32 interrupt sources can be managed by the interrupt controller through a multiple priority system which provides the user with the ability to customize the interrupt handling. the interrupt system of m2 includes a peripheral event controller (pec). this processor performs single-cycle interrupt-driven byte or word transfers between any two locations in the entire memory space of m2. in m2, the pec functionalities are extended by the external pec which allows an external device to trigger a pec transfer while providing the source and destination pointers. new features also include the packet transfer mode and the channel link mode. besides user interrupts, the interrupt controller provides mechanisms to process exceptions or error conditions, so-called ? hardware traps ? , that arise during program execution. system control unit m2 ? s system control unit (cscu) is used to control system specific tasks such as reset control or power management within an on-chip system built around the core. the power management features of the cscu provide effective means to realize standby conditions for the system with an optimum balance between power reduction, peripheral operation and system functionality. the cscu also provides an interface to the clock generation unit (cgu) and is able to control the operation of the real time clock (rtc). the cscu includes the following functions:  system configuration control  reset sequence control  external interrupt and frequency output control  watchdog timer module  general xbus peripherals control  power management additional to the standard idle and power down modes  control interface for clock generation unit  identification register block for chip and cscu identification
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 6 micronas ocds the on-chip debug system allows the detection of specific events during user program execution through software and hardware breakpoints. an additional communication module allows communication between the ocds and an external debugger, through a standard jtag port. this communication is performed in parallel to program execution.
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 7 micronas 4.2 memory organization in normal operation mode the memory space of the cpu is configured in a ? von neumann ? architecture. this means that code and data are accessed within the same memory areas, i. e. external memory, internal controller memory (iram), the address areas for integrated xbus peripherals (i 2 c, internal xbus memory (xram)) and the special function register areas (sfr, esfr) are mapped into one common address space of 16 mbytes. this address space is arranged as 256 segments of 64 kbytes each and each segment is again subdivided into four data pages of 16 kbytes each. all internal memory areas and the address space of the integrated xbus peripherals are mapped to segment 0. code and data may be stored in any part of the memory, except for the sfr blocks, which can not be used for instructions. despite this equivalence of code and data, proper partitioning is necessary to make use of the full bandwidth of the memory system. the integrated c16x controller communicates via 2 busses with the memory interface. in normal operation mode access to segments 00 h to 41 h (excluding internal memory areas) is mapped to the read only program memory bus (pmbus), whereas access to segments 42 h to ff h is mapped to the xbus. in bootstrap loader mode (bslmode) instruction fetches to external memory areas via pmbus are redirected to the internal bootstrap loader rom (bslrom). operand (data) accesses remain unchanged. the pmbus is connected to the instruction cache (icache) which operates as read- ahead fifo (see figure 4-1 ). the data cache (dcache) which is connected to the xbus holds a maximum of 4 words corresponding to one sdram burst. accesses of dcache, icache and the acquisition unit (acq) are joined within the acquisition memory interface (ami) and directed to the external bus interface (ebi). redirections via esfr redir (instruction fetches only) and esfr redir1 are done in the ami (see chapter 4.5.1 ). the ebi joins ami and display generator (dg) accesses and reads data from or writes data to the external static and dynamic memory devices (see chapter 4.5 for further information). in case of cache miss wait states are inserted until the data is ready. iram, xram and the special function register areas can be accessed without wait states.
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 8 micronas figure 4-1 m2 memory path block diagram all memory locations are byte and word readable. the internal memories (iram, xram) and the external dynamic memory (sdram) are byte and word writable, but external static memory is only word writable. bytes are stored at even or odd byte addresses. words are stored in ascending memory locations, with the low byte at an even byte address being followed by the high byte at the next odd byte address. double words (instructions only) are stored in ascending memory locations as two subsequent words. single bits are always stored in the specific bit position at a word address. bit position 0 is the least significant bit of the byte at an even byte address and bit position 15 is the most significant bit of the byte at the next odd byte address. bit addressing is supported by a part of the special function registers, a part of the iram and the general purpose registers (gprs). ued11214 sdram rom1 rom2 ebi ami icache dcache acq c16x boot rom dg pmbus xbus memory external m2
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 9 micronas figure 4-2 storage of words, byte and bits in a byte organized memory note: byte units forming a single word or a double word must always be stored within the same physical (internal, external, rom, ram) and organizational (page, segment) memory area.
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 10 micronas 4.3 on-chip microcontroller ram and sfr area the iram/sfr area is located within data page 3, and provides access to 2 kbyte of dual ported iram and two 512 byte blocks of special function registers (sfrs). the internal ram (iram) serves several purposes:  system stack (programmable size)  general purpose register banks (gprs)  source and destination pointers for the peripheral event controller (pec)  variable and other data storage, or  code storage figure 4-3 internal ram areas and sfr areas note: the upper 256 bytes of sfr area, esfr area and iram are bit-addressable (see shaded blocks in figure 4-3 ). ued11213 00 ? 8000 00 ? 0000 h page 0 h 00 ? 4000 h page 1 00 ? f600 00 ? f000 00 ? f200 esfr area reserved h h h ram / sfr area 64 kbytes segment 0 00 ? c000 h page 2 page 3 00 ? f000 h 00 ? ffff h 00 ? ffff 00 ? fa00 00 ? fe00 2 kbyte iram ram / sfr area 4 kbytes sfr area h h h xram 00 ? e800 h 00 ? e000 h 2 c
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 11 micronas code accesses are always made through even byte addresses. the highest possible code storage location in the iram is either 00 ? fdfe h for single word instructions, or 00 ? fdfc h for double word instructions. the respective location must contain a branch instruction (unconditional), because sequential boundary crossings from iram to the sfr area are not supported and cause erroneous results. any word and byte data in the iram can be accessed via indirect or long 16-bit addressing modes if the selected dpp register points to page 3. any word data access is made through an even byte address. the highest possible word data storage location in the iram is 00 ? fdfe h . for pec data transfers, the iram can be accessed independent of the contents of the dpp registers via the pec source and destination pointers. the upper 256 byte of the iram (00 ? fd00 h through 00 ? fdff h ) and the gprs of the current bank are provided for single bit storage, and thus they are bit addressable. 4.3.1 system stack the system stack may be defined within the iram. the size of the system stack is controlled by bit field stksz in the syscon register (see table below). for all system stack operations, the iram is accessed via the stack pointer (sp) register. the stack grows downward from higher to lower ram address locations. only word accesses are supported by the system stack. a stack overflow (stkov) and a stack underflow (stkun) register are provided to control the lower and upper limits of the selected stack area. these two stack boundary registers can be used not only for protection against data destruction, but also to implement flushing and filling a circular stack with a hardware supported system stack (except for option ? 111 ? ). stack size (words) internal ram addresses (words) 0 0 0 b 256 00 ? fbfe h ? 00 ? fa00 h (default after reset) 0 0 1 b 128 00 ? fbfe h ? 00 ? fb00 h 0 1 0 b 64 00 ? fbfe h ? 00 ? fb80 h 0 1 1 b 32 00 ? fbfe h ? 00 ? fbc0 h 1 0 0 b 512 00 ? fbfe h ? 00 ? f800 h 1 0 1 b ? reserved. do not use this combination. 1 1 0 b ? reserved. do not use this combination. 1 1 1 b 1024 00 ? fdfe h ? 00 ? f600 h (note: no circular stack)
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 12 micronas 4.3.2 general purpose registers the general purpose registers (gprs) use a block of 16 consecutive words within the iram. the context pointer (cp) register determines the base address of the currently active register bank. this register bank may consist of up to 16 word gprs (r0, r1, ? , r15) and/or of up to 16 byte gprs (rl0, rh0, ? , rl7, rh7). the sixteen byte gprs are mapped onto the first eight word gprs (see table 4-1 ). in contrast to the system stack, a register bank grows from lower towards higher address locations and occupies a maximum space of 32 byte. the gprs are accessed via short 2-, 4- or 8-bit addressing modes using the context pointer (cp) register as a base address (independent of the current dpp register contents). in addition, each bit in the currently active register bank can be accessed individually. m2 supports fast register bank (context) switching. multiple register banks can physically exist within the iram at the same time. however, only the register bank selected by the context pointer register (cp) is active at a given time. selecting a new active register bank is simply done by updating the cp register. a particular switch context (scxt) instruction performs register bank switching and automatically saves the previous table 4-1 mapping of general purpose registers to ram addresses internal ram address byte registers word register + 1e h ? r15 + 1c h ? r14 + 1a h ? r13 + 18 h ? r12 + 16 h ? r11 + 14 h ? r10 + 12 h ? r9 + 10 h ? r8 + 0e h rh7 rl7 r7 + 0c h rh6 rl6 r6 + 0a h rh5 rl5 r5 + 08 h rh4 rl4 r4 + 06 h rh3 rl3 r3 + 04 h rh2 rl2 r2 + 02 h rh1 rl1 r1 + 00 h rh0 rl0 r0
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 13 micronas context. the number of implemented register banks (arbitrary sizes) is only limited by the size of the available internal ram. 4.3.3 pec source and destination pointers the 16 word locations in the iram from 00 ? fce0 h to 00 ? fcfe h (just below the bit- addressable section) are provided as source and destination offset address pointers for data transfers on the eight pec channels. each channel uses a pair of pointers stored in two subsequent word locations, with the source pointer (srcpx) on the lower and the destination pointer (dstpx) on the higher word address (x = 7 ? 0). in m2, these pointers are used to specify the address offset within the segment, and the destination / source segment numbers are specified in designated sfrs (see chapter 5.2 ). figure 4-4 location of the pec pointers whenever a pec data transfer is performed, the pair of source and destination pointers, which is selected by the specified pec channel number, is accessed independent of the current dpp register contents; the locations referred to by these pointers are also accessed independent of the current dpp register contents. if a pec channel is not used, the corresponding pointer locations are available and can be used for word or byte data storage. 00 ? fce2 00 ? fce0 h h srcp0 dstp0 00 ? f5fe 00 ? f600 mcd02266 h h destination 00 ? fcfc pointers and h pec source srcp7 00 ? fcfe h dstp7 internal 00 ? fce0 00 ? fdde ram h h 00 ? fcfe 00 ? fd00 h h
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 14 micronas 4.3.4 special function registers the so-called special function registers (sfrs) are provided to control internal functions of m2 (cpu, bus interface, interrupt controller, ocds) or peripherals connected to the peripheral bus. these sfrs are arranged within two areas of 512 bytes each. the first register block, the sfr area, is located in the 512 bytes above the internal ram (00 ? ffff h ? 00 ? fe00 h ); the second register block, the extended sfr (esfr) area, is located in the 512 bytes below the iram (00 ? f1ff h ? 00 ? f000 h ). special function registers can be addressed via indirect and long 16-bit addressing modes. using an 8-bit offset together with an implicit base address allows word sfrs and their respective low bytes to be addressed. however, this does not work for the respective high bytes! note: writing to any byte of an sfr causes the non-addressed complementary byte to be cleared! the upper half of each register block is bit-addressable, so the respective control/status bits can directly be modified or checked using bit addressing. when accessing registers in the esfr area using 8-bit addresses or direct bit addressing, an extend register (extr) instruction is first required to switch the short addressing mechanism from the standard sfr area to the extended sfr area. this is not required for 16-bit and indirect addresses. the gprs r15 ? r0 are duplicated, i.e. they are accessible within both register blocks via short 2-, 4- or 8-bit addresses without switching. esfr_switch_example: extr #4 ;switch to esfr area for next 4 instr. mov odp2, #data16 ;odp2 uses 8-bit reg addressing bfldl dp6, #mask, #data8 ;bit addressing for bit fields bset dp1h.7 ;bit addressing for single bits mov t8rel, r1 ;t8rel uses 16-bit mem address, ;r1 is duplicated into the esfr space ;(extr is not required for this access) ;---- ;------------------- ;the scope of the extr #4 instruction? ; ? ends here! mov t8rel, r1 ;t8rel uses 16-bit mem address, ;r1 is accessed via the sfr space in order to minimize the use of the extr instructions the esfr area primarily holds registers which are required mainly for initialization and mode selection. registers that need to be accessed frequently are allocated, wherever possible, to the standard sfr area.
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 15 micronas note: the tools are equipped to monitor accesses to the esfr area and will automatically insert extr instructions or issue a warning in case of missing or excessive extr instructions.
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 16 micronas 4.4 external memory m2 provides an external bus interface (ebi) to access an external sdram, together with an external static memory device (rom or sram). to optimize the overall system performance, access to both memory types is interlocked. because of high performance requirements m2 provides only one bus type (demultiplexed 16-bit bus). depending on the reset configuration (refer to chapter 6.1 ) an external rom/sram size from 128 kbyte up to 4 mbyte can be chosen. although external addresses (represented by pins a0 ? a20) are always word addresses, byte accesses to the sdram are possible by using mask signals ldqm and udqm. 4.4.1 sdram pc sdram compliant (intel standard) memory devices with 2 or 8 mbyte and a minimum clock period of 10 ns (latency 3) may be connected to m2 ? s external memory bus. supported data organizations are given below: the external sdram connected to m2 is a multifunctional, byte or word addressable device which can be used for frame buffers, character sets, pixel graphics, acquisitions, microcontroller workspace and any other data storage purposes. using a 100 mhz external memory bus the theoretical optimum memory bandwidth is limited to 200 mbyte/s. in order to keep the sustainable memory bandwidth as close to the optimum as possible, the bank oriented architecture of sdram devices has to be exploited. basically, display related information should be separated from controller related data items. the following allocation is recommended for a 2 bank, 2 mbyte device:  ?display bank? : both frame buffers, character set, pixel graphic, graphic accelerator instructions (gai), application data (i.e. ttx, epg, ? )  ?controller bank? : instruction code, vbi-buffer, application data (i.e. ttx, epg, ? ) the suggested allocation leads to best performance results since it reduces the number of time consuming row commands on the sdram. 4.4.2 external static memory devices m2 supports access to external rom, flash rom and sram devices which provide a read cycle time t rc < 120 ns. only 16-bit word access is supported. the maximum memory size # sdram banks # bank addresses # row addresses # column addresses 2 mbyte21118 8 mbyte42128
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 17 micronas memory size is limited by the number of external address lines. up to 21 external address lines are configurable, thus devices providing up to 4 mbyte of static external memory can be connected to m2.
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 18 micronas 4.5 external bus interface (ebi). the ebi handles access channels to four sdram banks within one sdram device and up to two static memory devices at 100 mhz. (for lower requirements the clock frequency can be reduced to 66 mhz, refer to chapter 8 ). a maximum of three external memory devices is supported. figure 4-5 shows the possible configurations. figure 4-5 external memory configuration the interlocking execution of access cycles to different memory modules is supported. all external sdram access cycles must be executed with a pre-defined burst length bl = 4 and latency 3. write access cycles, which modify less than four sdram locations, are achieved by activating mask control signals l/udqm. the integrated refresh controller of the ebi checks for the compliance of refresh periods and executes refresh operations on the sdram devices. the configuration of different external sdram types can be controlled by a special sw driver as well as refresh modes and power down features. the microcontroller and the acquisition unit use a common interface to the ebi. a separate connection to the ebi is provided for the display generator. the ebi performs an arbitration procedure for granting right access to either of the request sources. but granting right access to one source does not exclude requests initiated by the other source from being served. a maximum of two access requests from a source may be served consecutively if the other source is addressing an sdram location. up to four consecutive access cycles from the same source are served if the other source is addressing an external rom device. the following figures show typical timing diagrams that may be observed on the external bus. the first figure presents the interlocked execution of access cycles to the external rom and a sdram device. the other figure resumes the situation when both sources ueb11118 or m2 rom flash-rom (2...4 banks) 2...8 mbyte sdram flash-rom rom or 128 kbyte...4 mbyte 128 kbyte...4 mbyte
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 19 micronas address locations are in different sdram banks. detailed timings and the specification of setup and hold conditions can be found in chapter 14 . figure 4-6 interlocked access cycles to rom and sdram rom_adr rd csrom d(15:0) a(21:0) sdram data ca rom data ra uet11119 ra read cas wr ras memclk cssdram act write
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 20 micronas figure 4-7 interlocked access cycles to two sdram banks 4.5.1 memory mapping mapping of memory locations from the address space of the c16x to physical addresses (and chip selects) occurs in 4 steps (all addresses shown below are byte addresses unless otherwise noted). figure 4-8 gives a coarse depiction (without redirection) of the mapping process in normal operation mode. uet11120 memclk pre act act pre act read read read read ras cas sdram: 16 mbit, 2 banks ra ca ca ra ca ra ra ra ra a (9:0) a10 a11 b1 b1 b1 b1 b1 b1 b0 sdram: 64 mbit, 4 banks a10 a (9:0) ca ra ra ca ra ra ca ra ra ra ra ra a11 a(13:12) by by by by bx bx by by d(15:0) 7 68 12 3 412 3 4 6 5 7 8 1 zo bank 1 bank 0 bank y bank x b0 precharge activate activate precharge activate dx dy dx dy
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 21 micronas figure 4-8 memory mapping from c16x address-space to ebi address-space for 1 64mbit sdram (d) and 2 16mbit static memory devices (s1, s2) is shown on the left (xbus/ pmbus overlap). the right part shows the mapping for 1 64mbit sdram (d) and 2 32mbit static memory devices (s1, s2) (no xbus/pmbus overlap). redirection via redir/redir1 is not shown. the exclusion of the address space for internal memories b leads to 1 segment in physical memory that is either addressable only via pmbus a or not addressable at all c. to get access to these segments use redir1. a) internal mapping of the c16x: access to segments 0 to 64 selects the pmbus. the address range (00 ? 0000 h ... 40 ? ffff h ) is mapped to the range 00 ? 0000 h ... 3f ? ffff h shown to the icache, thus omitting the internal memories, the special function register areas and the xbus peripheral address space contained the range 00 ? 8000 h ... 01 ? 7fff h : ? c16x addresses 00?0000 h ... 00?7fff h are mapped to 00?0000 h ... 00?7fff h  c16x addresses 01?8000 h ... 40?ffff h are mapped to 00?8000 h ... 3f?ffff h 41 ? 0000 h 40 ? 0000 h 00 ? 0000 41 ? 0000 h pmbus h 40 ? 0000 00 ? 0000 01 ? 8000 h s1 ued11212 h c h h address-space 80 ? 0000 60 ? 0000 h h s1 s2 d ff ? ffff h ebi 41 ? 0000 xbus address-space c16x ff ? ffff 80 ? 0000 s2 d ebi address-space h h a b 00 ? 8000 h
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 22 micronas access to segments 65 to 255 selects the xbus. this address range (41 ? 0000 h ... ff ? ffff h ) is not remapped by the c16x. b) mapping by caches: in normal operation mode the address requested by the controller is not altered by icache and dcache. in bootstrap loader mode, instruction fetches via the icache are mapped to the boot rom by the icache:  address is mapped to address mod 40 h operand reads via icache and all accesses via dcache are passed unaltered to the ami. c) mapping and redirection in ami: address mapping in amidepends on the settings of the esfrs redir and redir1 as well as on the total amount of static memory. the mapping is done in the following order: 1) check for redirection via redir1: if the requested address lies in segment 255 the segment address is replaced by the low byte of redir1. 2) check for redirection via redir: if the address resulting from step1 lies in the address range specified by redir, the address is shifted to sdram area:  address is mapped to 80?0000 h + address ? redir_lower 16 kbytes 3) if the total amount of static memeory in 4 mbytes or less (i.e. salsel ? 111 ? or salsel = ? 111 ? and no second device present) and the address resulting from step 2 is below 4 mbytes the address is shifted by 4 mbytes:  address is mapped to address + 40?0000 h this means that the address ranges 02 ? 0000 h ... 40 ? ffff h (pmbus) and 41 ? 0000 h ... 7f ? ffff h (xbus) in the address space of the c16x are mapped to the same physical memory. the overlap allows to make use of 2 independent busses for code (pmbus) and data (xbus) for fast parallel access. if the total amount of static memory is 8 mbytes (i.e. salsel = ? 111 ? and a second device is present) no further mapping occurs. d) mapping to addresses of specific physical devices by ebi: 1) dynamic memory:  addresses 80?0000 h ... ff?ffff h (9f?ffff h ) access the 64mbit (16 mbit) sdram (cssdram ) 2) static memory: in the total amount of static memory is 4 mbytes or less (see above) the requests of the ami or the dg in the address range 40 ? 0000 h ... 7f ? ffff h are passed to the external static memory devices according to the salsel and csena settings (see chapter 6.1 ). the address range 00 ? 0000 h ... 3f ? ffff h must not be used. if the total amount of the static memory is 8 mbytes there is no reserved address range:
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 23 micronas  addresses 00?0000 h ... 3f?ffff h access the first static memory device (csrom )  addresses 40?0000 h ... 7f?ffff h access the second static memory device (cs3 ) the addresses shown on the external address lines of m2 are word oriented, starting at 0 for each device. the external bus interface (ebi) provides a special mode, the ? ebi direct mode ? , where the control pins to the sdram device are directly controlled by the cpu while the hw finite state machines of the ebi are bypassed. ? ebi direct mode ? is used for accomplishing operations on the sdram such as the execution of the requisite initialization sequence, power down mode entry/exit etc. when executing a direct mode command the ebi shifts the contents of register ebidir into the sdram control lines. t he m i cr o na s s d r a m d r i v er (r ef e r to d o cume n t l i st) p r ov i des app r o p r i a t e fu n c t i o n s f or executing operations in direct mode. 4.5.2 register description access cycles to addresses specified by bit fields redir_lower and redir_upper are redirected by hardware to the sdram area. the area to which the specified range is mapped, starts at the base address (80 ? 0000 h ) of the sdram. the range for redirection is selected in groups of 16 kbyte. using the redir register, access cycles to rom located routines may be redirected to copies of these routines in the sdram. redir reset value: 0000 h to gain access to memory areas covered by the read only pmbus or to areas not accessible at all (see figure 4-8 ) accesses to segment 255 can be redirected to any other segment in ebi address space. bit function redir_lower (7:0) base address of selected range in the rom area bitfield redir_lower specifies the msbs of the base address of the selected range. redir_upper (7:0) upper address of selected range in the rom area (exclusive) bitfield redir_upper specifies the msbs of the first no longer redirected 16 kbytes. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw redir_upper (7:0) redir_lower (7:0)
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 24 micronas redir1 reset value: 00ff h the configuration of the ? external bus interface ? and its operation mode is defined with the ebicon register. ebicon reset value: 0000 h the edmr request flag and the hardware controlled acknowledge flag edma are used during ? ebi direct mode ? for implementing a four-phase handshake which guarantees that each direct mode command is executed exactly once by the ebi. bit function redir1_seg (7:0) for access to segment 255, the segment part of the address is replaced by redir1_seg. bit function edmr ebi direct mode request flag ? 0 ? : ebi direct mode is disabled ? 1 ? : ebi direct mode is enabled note: this bit is only used for ebi direct mode. edma ebi direct mode acknowledge flag ? 0 ? : the ebi has not (yet) entered direct mode ? 1 ? : the ebi has entered direct mode note: this bit is only used for ebi direct mode. sdrsze sdram size ? 0 ? : 16 mbit (2 ? 2048 ? 256 ? 2b), 2 banks (bank = adr_11) ? 1 ? : 64 mbit (4 ? 4096 ? 256 ? 2b), 4 banks (bank = adr_13:12) refen refresh controller enable bit ? 0 ? : refresh controller for sdram is disabled ? 1 ? : refresh controller for sdram is enabled 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw - redir1_seg (7:0) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw r r rw - - - - - - - - - - - - ref en ed ma ed mr sdr sze
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 25 micronas figure 4-9 four-phase handshake  phase i: the controller requests a direct mode command which has not yet been executed by the ebi. the controller must not reset the edmr bit until the ebi acknowledges the edma bit (edma polling required).  phase ii: the ebi acknowledges the edma bit after executing the requested direct mode command. the ebi will not reset the edma bit before the requested edmr bit is reset.  phase iii: the requested edmr bit is reset while the acknowledged edma bit is still valid. this phase will only take one ebi clock period (no edma polling required).  phase iv: ebi is waiting for the next direct mode request. when executing a direct mode command the ebi shifts the contents of register ebidir into the external control pins of the sdram. ebidir reset value: 0000 h bit function adr_10 control bit for address pin a10 in direct mode wr_n control bit for pin wr in direct mode cas_n control bit for pin cas (a15) in direct mode ras_n control bit for pin ras (a14) in direct mode cs_n control bit for pin cssdram in direct mode clken control bit for pin clken in direct mode uet11123 edmr edma i ii iii iv phase 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw - - - - - - - - - - ras _n wr _n adr _10 cs _n clk en cas _n
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 26 micronas the setting required for initiating a certain command on the sdram has to be written to the ebidir register before the direct mode request, the edmr bit in the ebicon register is asserted. the following table shows the commands that may be executed in direct mode along with the associated settings of the ebidir register. the mrs command (mode register set) is used to program the sdram for the desired operating mode. when executing the mrs command, address lines a11-a10 encode the operating mode. m2 then issues a hardwired pattern that sets the sdram to latency mode 3 , wrap type linear and burst length 4 . for the correct handling of access cycles the user has to provide the ebi with information about the external memory configuration and memory sizes. the combination of reset configuration and the sdrsze bit of the ebicon register includes all the information needed. based on these inputs the ebi constructs its internal address map for allocating rom devices and sdram banks. the external memory configuration is defined with bit csena of the rp0h register (refer to chapter 6.1 ). the memory configuration controls the correct behavior of pin cs3 . clken n-1 clken n cs_n ras_n cas_n we_n adr_10 device deselect dsel 1dc 1) 1) dc = don ? t care 1dcdcdcdc no operation nop 1dc0111dc precharge all banks pall 1dc00101 auto refresh cbr 110001dc self refresh entry selfrsh 100001dc self refresh exit selfrshx 0 1 1dcdcdcdc power down entry pwrdn 1 0 dc dc dc dc dc power down exit pwrdnx 0 1 1dcdcdcdc mode register set mrs 1dc00000
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 27 micronas . the allocation of address ranges for the sdram banks is controlled through the sdrsze bit. if a second rom device is enabled, its base address depends on the maximum size of both rom devices as defined within bit field salsel of register rp0h during reset. . 4.5.3 crossing memory boundaries the address space of m2 is implicitly divided into equally sized blocks of different granularity and into logical memory areas. crossing the boundaries between these bit function csena chip select enable ? 0 ? : cs3 is active for 2nd rom device ? 1 ? : cs3 is inactive sdrsze = ? 0 ? (16 mbit): addr ess ranges of banks bank address range bank1 80 ? 0000 h - 8f ? ffff h bank2 90 ? 0000 h - 9f ? ffff h sdrsze = ? 1 ? (64 mbit): addr ess ranges of banks bank address range bank1 80 ? 0000 h - 9f ? ffff h bank2 a0 ? 0000 h - bf ? ffff h bank3 c0 ? 0000 h - df ? ffff h bank4 e0 ? 0000 h - ff ? ffff h base address of 2nd rom device salsel physical base address ? 111 ? 2nd rom device not possible ? 110 ? 20 ? 0000 h ? 101 ? 10 ? 0000 h ? 100 ? 08 ? 0000 h ? 011 ? 04 ? 0000 h others 02 ? 0000 h
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 28 micronas blocks (code or data) or areas requires special attention to ensure that the controller executes the desired operations. memory areas are partitions of the address space that represent different kinds of memory (if provided at all). these memory areas are the internal ram/sfr area, the program memory (if available), the on-chip x-peripherals (if integrated) and the external memory. accessing subsequent data locations that belong to different memory areas is no problem. however, when executing code , the different memory areas must be switched explicitly via branch instructions. sequential boundary crossing is not supported and leads to erroneous results. note: changing from the external memory area to the internal ram/sfr area takes place within segment 0. segments are contiguous blocks of 64 kbyte each. they are referenced via the code segment pointer csp for code fetches and via an explicit segment number for data accesses overriding the standard dpp scheme. during code fetching segments are not changed automatically, but rather must be switched explicitly. the instructions jmps, calls and rets will do this. in larger sequential programs make sure that the highest used code location of a segment contains an unconditional branch instruction to the respective following segment, to prevent the prefetcher from trying to leave the current segment. data pages are contiguous blocks of 16 kbyte each. they are referenced via the data page pointers dpp3 ? 0 and via an explicit data page number for data accesses overriding the standard dpp scheme. each dpp register can select one of the 1024 possible data pages. the dpp register that is used for the current access is selected via the two upper bits of the 16-bit data address. subsequent 16-bit data addresses that cross the 16 kbyte data page boundaries will therefore use different data page pointers, while the physical locations need not be subsequent within memory.
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 29 micronas 4.6 central processing unit basic tasks of the cpu are to fetch and decode instructions, to supply operands for the arithmetic and logic unit (alu), to perform operations on these operands in the alu, and to store the previously calculated results. since a four stage pipeline is implemented in m2, up to four instructions can be processed in parallel. most instructions of m2 are executed in one machine cycles (2 cpu clock cycles) due to this parallelism. this chapter describes how the pipeline works for sequential and branch instructions in general, and which hardware provisions have been made, in particular, to speed up the execution of jump instructions. the description of the general instruction timing includes standard and exceptional timing. for instruction and operand fetches, the cpu is connected to the different areas (external memory, program memory, internal dual-port ram or (e)sfr area) either internally or through the interfaces of the cpu (xbus, program memory bus or peripheral bus). where the program memory bus and the peripheral bus are tightly coupled to the cpu, xbus accesses are performed, if possible, in parallel while the cpu continues operating. if data is required but not yet available or if a new xbus access is requested by the cpu before a previous access has been completed, the cpu will be held until the request can be satisfied. figure 4-10 cpu block diagram mcb02147 cpu sp stkov stkun instr. reg. instr. ptr. exec. unit 4-stage pipeline mdh mdl psw syscon context ptr. mul/div-hw r15 r0 general purpose registers bit-mask gen barrel - shifter alu (16-bit) data page ptr. code seg. ptr. internal ram r15 r0 rom 16 16 32 buscon 0 buscon 1 buscon 2 buscon 3 buscon 4 addrsel 4 addrsel 3 addrsel 2 addrsel 1
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 30 micronas peripheral units are connected to the cpu by the peripheral bus or the xbus and can work practically independent of the cpu. data and control information is interchanged between the cpu and these peripherals by special function registers (sfrs) or external memory locations, depending on to which bus they are connected. whenever peripherals need a non-deterministic cpu action, the interrupt controller compares all pending peripheral service requests with each other and prioritizes one of them. if the priority of the current cpu operation is lower than the priority of the selected peripheral request, an interrupt will occur. basically, there are two types of interrupt processing:  standard interrupt processing forces the cpu to save the current program status and the return address to the stack before branching to the interrupt vector jump table.  pec interrupt processing steals just one machine cycle from the current cpu activity to perform a single data transfer via the on-chip peripheral event controller (pec). system errors detected during program execution (so-called hardware traps) are also processed as standard interrupts with a very high priority. besides its normal operation there are the following particular cpu states:  reset state: any reset (hardware, software, watchdog) forces the cpu into a predefined active state.  idle state: the clock signal to the cpu itself is switched off, while the clocks for the peripherals keep running.  power down state: all of the on-chip clocks are switched off. a transition into an active cpu state is forced by an interrupt (if in idle mode) or by a reset (if in power down mode). the idle, power down and reset states can be entered by particular system control instructions. a set of special function registers is dedicated to the functions of the cpu core:  general system configuration: syscon (rp0h)  cpu status indication and control: psw  code access control: ip, csp  data paging control: dpp0, dpp1, dpp2, dpp3  gprs access control: cp  system stack access control: sp, stkun, stkov  multiply and divide support: mdl, mdh, mdc  alu constants support: zeros, ones 4.6.1 instruction pipelining the instruction pipeline of the cpu separates instruction processing into four stages, and each one has an individual task:
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 31 micronas 1st ? >fetch: in this stage the instruction selected by the instruction pointer (ip) and the code segment pointer (csp) is fetched from either the program memory, internal ram, or external memory. 2nd ? >decode: in this stage the instructions are decoded and, if required, the operand addresses are calculated and the respective operands are fetched. for all instructions, which implicitly access the system stack, the sp register is either decremented or incremented, as specified. for branch instructions the instruction pointer and the code segment pointer are updated to the desired branch target address (provided that the branch is taken). 3rd ? >execute: in this stage an operation is performed on the previously fetched operands in the alu. in addition, the condition flags in the psw register are updated, as specified by the instruction. all explicit writes to the sfr memory space and all auto-increment or auto- decrement writes to gprs used as indirect address pointers are also performed during the execute stage of an instruction. 4th ? >write back: in this stage all external operands and the remaining operands within the internal ram space are written back. a particularity of the cpu are the so-called imported instructions. these imported instructions are internally generated by the machine to provide the time needed to process instructions which cannot be processed within one machine cycle. they are automatically imported into the decoding stage of the pipeline, and then they pass through the remaining stages like all standard instructions. program interrupts are also performed by means of imported instructions. although these internally imported instructions will not be noticed in reality, they are introduced here to ease the explanation of the pipeline in the following: sequential instruction processing each single instruction has to pass through each of the four pipeline stages regardless of whether all possible stage operations are performed or not. since passing through one pipeline stage takes at least one machine cycle, any isolated instruction takes at least four machine cycles to be completed. pipelining, however, allows parallel (i.e. simultaneous) processing of up to four instructions. thus, most of the instructions seem to be processed during one machine cycle as soon as the pipeline has been filled once after reset (see figure 4-11 ).
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 32 micronas instruction pipelining increases the average instruction throughput considered over a certain period of time. in the following, any execution time specification of an instruction always refers to the average execution time due to pipelined parallel instruction processing. figure 4-11 sequential instruction pipelining standard branch instruction processing instruction pipelining helps to speed up sequential program processing. when a branch is taken, the instruction which has been fetched in advance is usually not the instruction which must be decoded next. thus, at least one additional machine cycle is normally required to fetch the branch target instruction. this extra machine cycle is provided by means of an imported instruction (see figure 4-12 ). figure 4-12 standard branch instruction pipelining if a conditional branch is not taken, there is no deviation from the sequential program flow, and thus no extra time is required. in this case, the instruction following the branch instruction will enter the decoding stage of the pipeline at the beginning of the next machine cycle after decoding the conditional branch instruction. ued11124 1 ii 2 i 3 i 4 i 5 i 6 1 i 2 i 1 i 3 i 2 i 1 i 3 i 2 i i 4 4 i 3 i i 5 fetch decode execute writeback 1 machine cycle time ued11125 i n+2 i target fetch decode execute writeback 1 machine cycle n i branch ... ... ... i n branch inject i () branch n i target+1 i target i i () inject branch i inject target ( i ) target+1 i target+2 i target+2 target+1 i target i i target+3 i injection time
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 33 micronas cache jump instruction processing the cpu incorporates a jump cache to optimize conditional jumps, which are processed repeatedly within a loop. whenever a jump on cache is taken, the extra time to fetch the branch target instruction can be saved, therefore causing the corresponding cache jump instruction to need only one machine cycle. this performance is achieved by the following mechanism: whenever a cache jump instruction passes through the decode stage of the pipeline for the first time (and provided that the jump condition is met), the jump target instruction is fetched as usual, causing a time delay of one machine cycle. in contrast to standard branch instructions, however, the target instruction of a cache jump instruction (jmpa, jmpr, jb, jbc, jnb, jnbs) is additionally stored in the cache after having been fetched. after repeatedly following each execution of the same cache jump instruction, the jump target instruction is not fetched from program memory but taken from the cache and immediately imported into the decoding stage of the pipeline (see figure 4-13 ). a time saving jump on cache is always taken after the second and any further occurrence of the same cache jump instruction, unless an instruction, which has the fundamental capability of changing the csp register contents (jmps, calls, rets, trap, reti), or any standard interrupt has been processed during the period of time between two following occurrences of the same cache jump instruction. figure 4-13 cache jump instruction pipelining particular pipeline effects since up to four different instructions are processed simultaneously, additional hardware has been used in the cpu to consider all causal dependencies which may exist on instructions in different pipeline stages without a loss of performance. this extra hardware (i.e. for ? forwarding ? operand read and write values) resolves most of the ued11126 i n+2 i target fetch decode execute writeback 1 machine cycle 1st loop iteration ... i n cache jmp inject i () target+1 i target+2 i injection cache jmp i n i inject target ( i ) target+1 i cache jmp cache jmp i ... n i n+2 target+1 target i i cache jmp i n target i cache jmp repeated loop iteration target instruction injection of cached
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 34 micronas possible conflicts (e.g. multiple usage of buses) in a time optimized way and thus usually avoids the pipeline being noticed by the user. however, there are some very rare cases, where the cpu, being a pipelined machine, requires attention by the programmer. in these cases the delays caused by pipeline conflicts can be used for other instructions in order to optimize performance. context pointer updating an instruction which calculates a physical gpr operand address via the cp register, is mostly not capable of using a new cp value, which is to be updated by an immediately preceding instruction. thus, to make sure that the new cp value is used, at least one instruction must be inserted between a cp-changing and a subsequent gpr-using instruction, as shown in the following example: i n : scxt cp, #0fc00h ; select a new context i n+1 : ? . ; must not be an instruction using a gpr i n+2 : mov r0, #datax ; write to gpr 0 in the new context data page pointer updating an instruction, which calculates a physical operand address via a particular dppn (n = 0 to 3) register, is mostly not capable of using a new dppn register value, which is to be updated by an immediately preceding instruction. thus, to make sure that the new dppn register value is used, at least one instruction must be inserted between a dppn- changing instruction and a subsequent instruction which implicitly uses dppn via a long or indirect addressing mode, as shown in the following example: i n : mov dpp0, #4 ; select data page 4 via dpp0 i n+1 : ? . ; must not be an instruction using dpp0 i n+2 : mov dpp0:0000h, r1; move contents of r1 to address location 01 ? 0000 h ; (in data page 4) supposed segmentation is enabled explicit stack pointer updating none of the ret, reti, rets, retp or pop instructions are capable of correctly using a new sp register value, which is to be updated by an immediately preceding instruction. thus, in order to use the new sp register value without erroneously performed stack accesses, at least one instruction must be inserted between an explicitly sp-writing and any subsequent just mentioned implicitly sp-using instructions, as shown in the following example: i n : mov sp, #0fa40h; select a new top of stack i n+1 : ? . ; must not be an instruction popping operands ; from the system stack
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 35 micronas i n+2 : pop r0 ; pop word value from new top of stack into r0 note: conflicts with instructions writing to the stack (push, call, scxt) are solved internally by the cpu logic. controlling interrupts software modifications (implicit or explicit) of the psw are done in the execute phase of the respective instructions. in order to maintain fast interrupt responses, however, the current interrupt prioritization round does not consider these changes, i.e. an interrupt request may be acknowledged after the instruction that disables interrupts via ien or ilvl or after the subsequent instructions. timecritical instruction sequences therefore should not begin directly after the instruction disabling interrupts, as shown in the following example: int_off: bclr ien ; globally disable interrupts i n-1 ; non-critical instruction crit_1st: i n ; begin of uninterruptable critical sequence ... crit_last:i n+x ; end of uninterruptable critical sequence int_on: bset ien ; globally re-enable interrupts note: the described delay of 1 instruction also applies for enabling the interrupts system i.e. no interrupt requests are acknowledged until the instruction after the enabling instruction. changing the system configuration the instruction following an instruction that changes the system configuration via register syscon (e.g. the mapping of the program memory, segmentation, stack size) cannot use the new resources (e.g. program memory or stack). in these cases an instruction that does not access these resources should be inserted. code accesses to the new program memory area are only possible after an absolute branch to this area. note: as a rule, instructions that change program memory mapping should be executed from internal ram or external / xbus memory. buscon/addrsel and xbcon/xadrs the instruction following an instruction that changes the properties of an external / xbus address area cannot access operands within the new area. in these cases an instruction that does not access this address area should be inserted. code accesses to the new address area should be made after an absolute branch to this area. note: as a rule, instructions that change external bus properties should not be executed from the respective external memory area.
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 36 micronas timing instruction pipelining reduces the average instruction processing time on a wide scale (usually from four to one machine cycles). however, there are some rare cases where a particular pipeline situation causes the processing time for a single instruction to be extended either by a half or by one machine cycle. although this additional time represents only a tiny part of the total program execution time, it might be of interest to avoid these pipeline-caused time delays in time critical program modules. besides a general execution time description, the following section provides some hints on how to optimize time-critical program parts with regard to such pipeline-caused timing particularities. 4.6.2 bit-handling and bit-protection the cpu provides several mechanisms to manipulate bits. these mechanisms either manipulate software flags within the internal ram, control on-chip peripherals via control bits in their respective sfrs or control io functions via port pins. the instructions bset, bclr, band, bor, bxor, bmov, bmovn explicitly set or clear specific bits. the instructions bfldl and bfldh allow the manipulation of up to 8 bits of a specific byte at one time. the instructions jbc and jnbs implicitly clear or set the specified bit when the jump is taken. the instructions jb and jnb (also conditional jump instructions that refer to flags) evaluate the specified bit to determine if the jump is to be taken. note: bit operations on undefined bit locations will always read a bit value of ? 0 ? , while the write access will not effect the respective bit location. all instructions that manipulate single bits or bit groups internally use a read-modify-write sequence that accesses the whole word, which contains the specified bit(s). this method has several consequences:  bits can only be modified within the internal address areas, i.e. internal ram and sfrs. external locations cannot be used with bit instructions. the upper 256 bytes of the sfr area, the esfr area and the internal ram are bit- addressable (see chapter 4.2 ), i.e. those register bits located within the respective sections can be directly manipulated using bit instructions. the other sfrs must be byte/ word accessed. note: all gprs are bit-addressable independent of the allocation of the register bank via the context pointer cp. even gprs which are allocated to not bit-addressable ram locations provide this feature.  the read-modify-write approach may be critical with hardware-effected bits. in these cases the hardware may change specific bits while the read-modify-write operation is in progress, where the writeback would overwrite the new bit value generated by the hardware. the solution is either the implemented hardware protection (see below) or
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 37 micronas realization through special programming (see ? particular pipeline effects ? on page 33 ). protected bits are not changed during the read-modify-write sequence, i.e. when hardware sets e.g. an interrupt request flag between the read and the write of the read- modify-write sequence. the hardware protection logic guarantees that only the intended bit(s) is/are effected by the write-back operation. note: if a conflict occurs between a bit manipulation generated by hardware and an intended software access the software access has priority and determines the final value of the respective bit. 4.6.3 instruction state times basically, the time needed to execute an instruction depends on where the instruction is fetched from, and where possible operands are read from or written to. the fastest processing mode of m2 is the execution of a program fetched from the program memory. in this case most of the instructions can be processed within just one machine cycle, which is also the general minimum execution time. this section summarizes the execution times in a very condensed way. a detailed description of the execution times for the various instructions and the specific exceptions can be found in the ? c16x family instruction set manual ? . the table below shows the minimum execution times required to process an m2 instruction fetched from the program memory, the internal ram or from external / xbus memory. these execution times apply to most of the m2 instructions - except some of the branches, the multiplication, the division and a special move instruction. in case of program execution from the program memory there is no execution time dependency on the instruction length except for some special branch situations. the numbers in the table are in units of cpu clock cycles and assume no wait-states. execution from the internal ram provides flexibility in terms of loadable and modifiable code on the account of execution time. table 4-2 minimum execution times instruction fetch word operand access memory area word instruction doubleword instruction read from write to internal code memory 2 2 2 ? internal ram 6 8 0/1 0 16-bit demux bus2422 16-bit mux bus3633
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 38 micronas execution from external memory strongly depends on the selected bus mode and the programming of the bus cycles (wait-states). the operand and instruction accesses listed below can extend the execution time of an instruction:  internal code memory operand reads (same for byte and word operand reads)  internal ram operand reads via indirect addressing modes  internal sfr operand reads immediately after writing  external operand reads  external operand writes  jumps to non-aligned double word instructions in the program memory space  testing branch conditions immediately after psw writes 4.6.4 cpu special function registers the cpu requires a set of special function registers (sfrs) to maintain the system state information, to supply the alu with register-addressable constants and to control system and bus configuration, multiply and divide alu operations, code memory segmentation, data memory paging, and accesses to the general purpose registers and the system stack. the access mechanism for these sfrs in the cpu core is identical to the access mechanism for any other sfr. since all sfrs can simply be controlled by means of any instruction, which is capable of addressing the sfr memory space, a lot of flexibility has been gained, without the need to create a set of system-specific instructions. note, however, that there are user access restrictions for some of the cpu core sfrs to ensure proper processor operations. the instruction pointer ip and code segment pointer csp cannot be accessed directly. they can only be changed indirectly via branch instructions. the psw, sp, and mdc registers can not only be modified explicitly by the programmer, but also implicitly by the cpu during normal instruction processing. note that any explicit write request (via software) to an sfr supersedes a simultaneous modification by hardware of the same register. note: any write operation to a single byte of an sfr clears the non-addressed complementary byte within the specified sfr. non-implemented (reserved) sfr bits cannot be modified, and will always supply a read value of '0'. system configuration register syscon this bit-addressable register provides general system configuration and control functions. the reset value for register syscon depends on the state of the port4 pins during reset.
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 39 micronas syscon reset value: 0400 h bit function xpen xbus peripheral enable bit ? 0 ? : accesses to the on-chip x-peripherals and their functions are disabled. ? 1 ? : the on-chip x-peripherals are enabled and can be accessed. rsoen reset output enable bit ? 0 ? : the contrast reduction signal is driven on pin 104. ? 1 ? : the reset output signal is driven on pin 104, i.e. pin 104 is pulled low during internal reset sequence. note: refer also to chapter 6.7 cscfg select line configuration control ? 0 ? : latched select line mode for x-peripherals. ? 1 ? : select lines for access cycles via xbus are directly derived from the address lines. note: cscfg = ? 1 ? is recommended. the effect of the switch is not visible at an external interface. romen pm-bus enable bit ? 0 ? : pm-bus disabled: accesses to the rom area use the xbus. ? 1 ? : pm-bus enabled: pm-bus enabled for access cycles to the rom area. note: the recommended value romen = ? 1 ? is set by hardware during reset. sgtdis segmentation disable/enable control ? 0 ? : segmentation enabled (csp is saved/restored during interrupt entry/exit). ? 1 ? : segmentation disabled (only ip is saved/restored). 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw stksz(2..0) rom s1 sgt dis rom en - - - cs cfg - - rso en xpen - - rw
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 40 micronas note: register syscon cannot be changed after execution of the einit instruction. segmentation disable/enable control (sgtdis) bit sgtdis allows to select either the segmented or non-segmented memory mode. in non-segmented memory mode (sgtdis = ? 1 ? ) it is assumed that the code address space is restricted to 64 kbytes (segment 0) and thus 16 bits are sufficient to represent all code addresses. for implicit stack operations (call or ret) the csp register is totally ignored and only the ip is saved to and restored from the stack. in segmented memory mode (sgtdis = ? 0 ? ) it is assumed that the whole address space is available for instructions. for implicit stack operations (call or ret) the csp register and the ip are saved to and restored from the stack. after reset the segmented memory mode is selected. note: bit sgtdis controls if the csp register is pushed onto the system stack in addition to the ip register before an interrupt service routine is entered, and it is repopped when the interrupt service routine is left again. system stack size (stksz) this bitfield defines the size of the physical system stack, which is located in the internal ram of m2. an area of 32 ? 512 words or all of the internal ram may be dedicated to the system stack. a so-called ? circular stack ? mechanism allows the use of a bigger virtual stack than this dedicated ram area. the processor status word psw this bit-addressable register reflects the current state of the microcontroller. two groups of bits represent the current alu status, and the current cpu interrupt status. a separate bit (usr0) within register psw is provided as a general purpose user flag. roms1 internal rom mapping ? 0 ? : external rom area mapped to segment 0 (00 ? 0000 h ? 00 ? 7fff h ) ? 1 ? : external rom area mapped to segment 1 (01 ? 0000 h ? 01 ? 7fff h ). note: roms1 = ? 0 ? is recommended. stksz (2 ? 0) system stack size selects the size of the system stack (in the internal ram) from 32 to 1024 words. bit function
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 41 micronas psw reset value: 0000 h alu status (n, c, v, z, e, mulip) the condition flags (n, c, v, z, e) within the psw indicate the alu status after the last recently performed alu operation. they are set by most of the instructions due to specific rules, which depend on the alu or data movement operation performed by an instruction. after execution of an instruction which explicitly updates the psw register, the condition flags cannot be interpreted as described in the following, because any explicit write to the psw register supersedes the condition flag values, which are implicitly generated by the cpu. explicitly reading the psw register provides a read value that represents the state of the psw register after execution of the immediately preceding instruction. note: after reset, all of the alu status bits are cleared. bit function n negative result set, when the result of an alu operation is negative. c carry flag set, when the result of an alu operation produces a carry bit. v overflow result set, when the result of an alu operation produces an overflow. z zero flag set, when the result of an alu operation is zero. e end of table flag set, when the source operand of an instruction is 8000 h or 80 h . mulip multiplication/division in progress ? 0 ? : there is no multiplication/division in progress. ? 1 ? : a multiplication/division has been interrupted. usr0 user general purpose flag may be used by the application software. hlden, ilvl, ien interrupt and ebc control fields define the response to interrupt requests and enable external bus arbitration. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw rw rw rw ilvl(3..0) ien hld en - - - usr0 mul ip e z v c n rw
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 42 micronas  n-flag: for most of the alu operations, the n-flag is set to ? 1 ? if the most significant bit of the result contains a ? 1 ? , otherwise it is cleared. in the case of integer operations the n-flag can be interpreted as the sign bit of the result (negative: n = ? 1 ? , positive: n= ? 0 ? ). negative numbers are always represented as the 2 ? s complement of the corresponding positive number. the range of signed numbers extends from ?? 8000 h ? to ? +7fff h ? for the word data type, or from ?? 80 h ? to ? +7f h ? for the byte data type. for boolean bit operations with only one operand, the n-flag represents the previous state of the specified bit. for boolean bit operations with two operands, the n-flag represents the logical xoring of the two specified bits.  c-flag: after an addition, the c-flag indicates that a carry from the most significant bit of the specified word or byte data type has been generated. after a subtraction or a comparison, the c-flag indicates a borrow, which represents the logical negation of a carry for the addition. this means that the c-flag is set to ? 1 ? if no carry from the most significant bit of the specified word or byte data type has been generated during a subtraction, which is performed internally by the alu as a 2 ? s complement addition, and the c-flag is cleared when this complement addition causes a carry. the c-flag is always cleared for logical, multiply and divide alu operations, because these operations cannot cause a carry. for shift and rotate operations the c-flag represents the value of the bit last shifted out. if a shift count of zero is specified, the c-flag will be cleared. the c-flag is also cleared for a prioritized alu operation because a ? 1 ? is never shifted out of the msb during the normalization of an operand. for boolean bit operations with only one operand the c-flag is always cleared. for boolean bit operations with two operands the c-flag represents the logical anding of the two specified bits.  v-flag: for addition, subtraction and 2 ? s complementation the v-flag is always set to ? 1 ? , if the result overflows the maximum range of signed numbers, which are representable by either 16 bits for word operations ( ?? 8000 h ? to ? +7fff h ? ), or by 8 bits for byte operations ( ?? 80 h ? to ? +7f h ? ), otherwise the v-flag is cleared. note that the result of an integer addition, integer subtraction, or 2 ? s complement is not valid if the v-flag indicates an arithmetic overflow. for multiplication and division the v-flag is set to ? 1 ? if the result cannot be represented in a word data type, otherwise it is cleared. note that a division by zero will always cause an overflow. in contrast to the result of a division, the result of a multiplication is valid regardless of whether the v-flag is set to ? 1 ? or not. since logical alu operations cannot produce an invalid result, the v-flag is cleared by these operations. the v-flag is also used as a ? sticky bit ? for rotate right and shift right operations. by only using the c-flag, a rounding error caused by a shift right operation can be estimated up to a quantity of one half of the lsb of the result. in conjunction with the
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 43 micronas v-flag, the c-flag allows the evaluation of the rounding error with a finer resolution (see table 4-3 ). for boolean bit operations with only one operand the v-flag is always cleared. for boolean bit operations with two operands the v-flag represents the logical oring of the two specified bits.  z-flag: the z-flag is normally set to ? 1 ? if the result of an alu operation equals zero, otherwise it is cleared. for the addition and subtraction with carry, the z-flag is only set to ? 1 ? if the z-flag already contains a ? 1 ? and the result of the current alu operation additionally equals zero. this mechanism is provided for the support of multiple precision calculations. for boolean bit operations with only one operand the z-flag represents the logical negation of the previous state of the specified bit. for boolean bit operations with two operands the z-flag represents the logical noring of the two specified bits. for the prioritized alu operation the z-flag indicates whether the second operand is zero or not.  e-flag: the e-flag can be altered by instructions, which perform alu or data movement operations. the e-flag is cleared by those instructions which cannot be reasonably used for table search operations. in all other cases the e-flag is set depending on the value of the source operand to signify whether the end of a search table is reached or not. if the value of the source operand of an instruction equals the lowest negative number, which is representable by the data format of the corresponding instruction ( ? 8000 h ? for the word data type, or ? 80 h ? for the byte data type), the e-flag is set to ? 1 ? , otherwise it is cleared.  mulip-flag: the mulip-flag will be set to ? 1 ? by hardware upon entry to an interrupt service routine, when a multiply or divide alu operation was interrupted before completion. depending on the state of the mulip bit, the hardware decides whether multiplication or division must be continued or not after the end of an interrupt service. the mulip bit is overwritten with the contents of the stacked mulip-flag when the return-from-interrupt-instruction (reti) is executed. this normally means that the mulip-flag is cleared again after that. note: the mulip flag is a part of the task environment. when the interrupting service routine does not return to the interrupted multiply/divide instruction (i.e. as in the table 4-3 shift right rounding error evaluation c-flag v-flag rounding error quantity 0 0 1 1 0 1 0 1 - no rounding error - 0 < rounding error < 1 / 2 lsb rounding error = 1 / 2 lsb rounding error > 1 / 2 lsb
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 44 micronas case of a task scheduler that switches between independent tasks), the mulip flag must be saved as part of the task environment and must be updated accordingly for the new task before this task is entered. cpu interrupt status (ien, ilvl) the interrupt enable bit allows for global enabling (ien = ? 1 ? ) or disabling (ien = ? 0 ? ) of interrupts. the four-bit interrupt level field (ilvl) specifies the priority of the current cpu activity. the interrupt level is updated by hardware upon entry into an interrupt service routine, but it can also be modified via software to prevent other interrupts from being acknowledged. in case an interrupt level ? 15 ? has been assigned to the cpu, it has the highest possible priority, and thus the current cpu operation cannot be interrupted except by hardware traps or external non-maskable interrupts. for details please refer to chapter 5 . after reset all interrupts are globally disabled, and the lowest priority (ilvl = 0) is assigned to the initial cpu activity. the instruction pointer ip this register determines the 16-bit intra-segment address of the currently fetched instruction within the code segment selected by the csp register. the ip register is not mapped into the m2 ? s address space, and thus it is not directly accessible by the programmer. the ip can, however, be modified indirectly via the stack by means of a return instruction. the ip register is implicitly updated by the cpu for branch instructions and after instruction fetch operations. ip reset value: 0000 h the code segment pointer csp this non-bit addressable register selects the code segment being used at run-time to access instructions. the lower 8 bits of register csp select one of up to 256 segments of 64 kbytes each, while the upper 8 bits are reserved for future use. bit function ip(15 ? 0) specifies the intra segment offset, from where the current instruction is to be fetched. ip refers to the current segment . 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r/w ip (15..0)
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 45 micronas csp reset value: 0000 h code memory addresses are generated by directly extending the 16-bit contents of the ip register by the contents of the csp register, as shown in figure 4-14 . in case of the segmented memory mode the selected number of segment address bits (via bit field salsel) of the csp register is output on the respective segment address pins of port 4 for all external code accesses. for non-segmented memory mode the content of this register is not significant, because all code accesses are automatically restricted to segment 0. note: the csp register can only be read but not written by data operations. it is, however, modified either directly by means of the jmps and calls instructions, or indirectly via the stack by means of the rets and reti instructions. upon the acceptance of an interrupt or the execution of a software trap instruction, the csp register is automatically set to zero. bit function segnr (7 ? 0) segment number specifies the code segment, from where the current instruction is to be fetched. segnr is ignored when segmentation is disabled. - - -- - 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 - - - r - - - - -- - - segnr(7..0)
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 46 micronas figure 4-14 addressing via the code segment pointer note: when segmentation is disabled, the ip value is used directly as the 16-bit address. the data page pointers dpp0, dpp1, dpp2, dpp3 these four non-bit addressable registers select up to four different data pages being active simultaneously at run-time. the lower 10 bits of each dpp register select one of the 1024 possible 16-kbyte data pages while the upper 6 bits are reserved for future use. the dpp registers allow access to the entire memory space in pages of 16 kbytes each. dpp0 reset value: 0000 h dpp1 reset value: 0001 h mca02265 255 1 15 0 ip register 254 0 code segment ff ? ffff h fe ? 0000 h 01 ? 0000 h 00 ? 0000 h csp register 15 0 24/20/18-bit physical code address - - - 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 - rw - - - - -- - - dpp0pn - - - 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 - rw - - - - -- - - dpp1pn
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 47 micronas dpp2 reset value: 0002 h dpp3 reset value: 0003 h the dpp registers are implicitly used whenever data accesses to any memory location are made via indirect or direct long 16-bit addressing modes (except for override accesses via extended instructions and pec data transfers). after reset, the data page pointers are initialized in a way that all indirect or direct long 16-bit addresses result in identical 18-bit addresses. this allows access to data pages 3 ? 0 within segment 0 as shown in the figure below. if the user does not want to use any data paging, no further action is required. data paging is performed by concatenating the lower 14 bits of an indirect or direct long 16-bit address with the contents of the dpp register selected by the upper two bits of the 16-bit address. the contents of the selected dpp register specify one of the 1024 possible data pages. this data page base address, together with the 14-bit page offset, forms the physical 24-bit address (selectable part is driven to the address pins). in case of non-segmented memory mode, only the two least significant bits of the implicitly selected dpp register are used to generate the physical address. thus, extreme care should be taken when changing the content of a dpp register if a non- segmented memory model is selected, because otherwise unexpected results could occur. in case of the segmented memory mode the selected number of segment address bits (via bit field salsel) of the respective dpp register is output on the respective segment address pins of port 4 for all external data accesses. a dpp register can be updated via any instruction, which is capable of modifying an sfr. bit function dppxpn data page number of dppx specifies the data page selected via dppx. only the least significant two bits of dppx are significant, when segmentation is disabled. - - - 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 - rw - - - - -- - - dpp2pn - - - 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 - rw - - - - -- - - dpp3pn
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 48 micronas note: due to the internal instruction pipeline, a new dpp value is not yet usable for the operand address calculation of the instruction immediately following the updating of the dpp register by the instruction. figure 4-15 addressing via the data page pointers the context pointer cp this non-bit addressable register is used to select the current register context. this means that the cp register value determines the address of the first general purpose register (gpr) within the current register bank of up to 16 word and/or byte gprs. cp reset value: fc00 h bit function cp modifiable portion of register cp specifies the (word) base address of the current register bank. when writing a value to register cp with bits cp.11 ? cp.9 = ? 000 ? , bits cp.11 ? cp.10 are set to ? 11 ? by hardware, in all other cases all bits of bit field ? cp ? receive the written value. mca02264 1023 1022 1021 3 2 1 0 dpp registers dpp3-11 dpp2-10 dpp1-01 dpp0-00 15 14 0 16-bit data address 14-bit intra-page address (concatenated with content of dppx). affer reset or with segmentation disabled the dpp registers select data pages 3...0. all of the internal memory is accessible in these cases. 1 0 1 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r rw r r r 11 r cp
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 49 micronas note: it is the user's responsibility that the physical gpr address specified via cp register plus short gpr address must always be an internal ram location. if this condition is not met, unexpected results may occur.  do not set cp below the iram start address, i.e. 00 ? fa00 h /00 ? f600 h /00 ? f200 h (1/2/3kb)  do not set cp above 00 ? fdfe h  be careful when using the upper gprs with cp above 00 ? fde0 h the cp register can be updated via any instruction which is capable of modifying an sfr. note: due to the internal instruction pipeline, a new cp value is not yet usable for gpr address calculations of the instruction immediately following the instruction updating the cp register. the switch context instruction (scxt) allows the saving of the contents of the cp register onto the stack and updating of it with a new value in just one machine cycle. figure 4-16 register bank selection via register cp several addressing modes use the cp register implicitly for address calculations. the addressing modes mentioned below are described in the ? c16x family instruction set manual ? .
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 50 micronas short 4-bit gpr addresses (mnemonic: rw or rb) specify an address relative to the memory location specified by the contents of the cp register, i.e. the base of the current register bank. depending on whether a relative word (rw) or byte (rb) gpr address is specified, the short 4-bit gpr address is sometimes multiplied by two before it is added to the contents of the cp register (see figure 4-17 ). thus, in this way, both byte and word gpr accesses are possible. gprs used as indirect address pointers are always word accessed. for some instructions only the first four gprs can be used as indirect address pointers. these gprs are specified by short 2-bit gpr addresses. the respective physical address calculation is identical to that for the short 4-bit gpr addresses. short 8-bit register addresses (mnemonic: reg or bitoff), within a range from f0 h to ff h , interpret the four least significant bits as short 4-bit gpr addresses, while the four most significant bits are ignored. the respective physical gpr address calculation is identical to that for the short 4-bit gpr addresses. for single bit accesses on a gpr, the gpr's word address is calculated as described above, but the position of the bit within the word is specified by a separate additional 4-bit value. figure 4-17 implicit cp use by short gpr addressing modes the stack pointer sp this non-bit addressable register is used to point to the top of the internal system stack (tos). the sp register is pre-decremented whenever data is to be pushed onto the stack, and it is post-incremented whenever data is to be popped from the stack. thus, the system stack grows from higher to lower memory locations. since the least significant bit of the sp register is tied to ? 0 ? , and bits 15 through 12 are tied to ? 1 ? by hardware, the sp register can only contain values from f000 h to fffe h . this allows access to a physical stack within the internal ram of the m2. a virtual stack
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 51 micronas (usually bigger) can be realized via software. this mechanism is supported by the stkov and stkun registers (see respective descriptions below). the sp register can be updated via any instruction, which is capable of modifying an sfr. note: due to the internal instruction pipeline, a pop or return instruction must not immediately follow an instruction updating the sp register. sp reset value: fc00 h the stack overflow pointer stkov this non-bit addressable register is compared against the sp register after each operation, which pushes data onto the system stack (e.g. push and call instructions or interrupts) and after each subtraction from the sp register. if the contents of the sp register are less than the content of the stkov register, a stack overflow hardware trap will occur. since the least significant bit of register stkov is tied to ? 0 ? and bits 15 through 12 are tied to ? 1 ? by hardware, the stkov register can only contain values from f000 h to fffe h . stkov reset value: fa00 h the stack overflow trap (entered when (sp) < (stkov)) may be used in two different ways:  fatal error indication treats the stack overflow as a system error through the associated trap service routine. under these circumstances data in the bottom of the bit function sp modifiable portion of register sp specifies the top of the internal system stack. bit function stkov modifiable portion of register stkov specifies the lower limit of the internal system stack. 1 0 1 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r rw r r r 11 r sp 1 0 1 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r rw r r r 11 r stkov
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 52 micronas stack may have been overwritten by the status information stacked upon the stack overflow trap service.  automatic system stack flushing allows the use of the system stack as a ? stack cache ? for a bigger external user stack. in this case the stkov register should be initialized to a value which represents the desired lowest top of stack address plus 12 according to the selected maximum stack size. this takes into consideration the worst case that could occur, when a stack overflow condition is only detected during entry into an interrupt service routine. then, six additional stack word locations are required to push ip, psw, and csp for both the interrupt service routine and the hardware trap service routine. the stack underflow pointer stkun this non-bit addressable register is compared against the sp register after each operation, which pops data from the system stack (e.g. pop and ret instructions) and after each addition to the sp register. if the content of the sp register is greater than the content of the stkun register, a stack underflow hardware trap will occur. since the least significant bit of register stkun is tied to ? 0 ? and bits 15 through 12 are tied to ? 1 ? by hardware, the stkun register can only contain values from f000 h to fffe h . stkun reset value: fc00 h the stack underflow trap (entered when (sp) > (stkun)) may be used in two different ways:  fatal error indication treats the stack underflow as a system error through the associated trap service routine.  automatic system stack refilling allows the use of the system stack as a ? stack cache ? for a bigger external user stack. in this case the stkun register should be initialized to a value which represents the desired highest bottom of stack address. scope of stack limit control the stack limit control, realized by the register pair stkov and stkun, detects cases where the stack pointer sp is moved outside the defined stack area either by add or bit function stkun modifiable portion of register stkun specifies the upper limit of the internal system stack. 1 0 1 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r rw r r r 11 r stkun
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 53 micronas sub instructions or by push or pop operations (explicit or implicit, i.e. call or ret instructions). this control mechanism is not triggered, i.e. no stack trap is generated, when  the stack pointer sp is directly updated via mov instructions  the limits of the stack area (stkov, stkun) are changed, so that sp is outside of the new limits. the multiply/divide high register mdh this register is a part of the 32-bit multiply/divide register, which is implicitly used by the cpu, when it performs a multiplication or a division. after a multiplication, this non-bit addressable register represents the high order 16 bits of the 32-bit result. for long division, the mdh register must be loaded with the high order 16 bits of the 32-bit dividend before the division is started. after any division, the mdh register represents the 16-bit remainder. mdh reset value: 0000 h whenever this register is updated via software, the multiply/divide register in use (mdriu) flag in the multiply/divide control register (mdc) is set to ? 1 ? . when multiplication or division is interrupted before its completion and when a new multiply or divide operation is to be performed within the interrupt service routine, the mdh register must be saved along with the mdl and mdc registers to avoid erroneous results. the multiply/divide low register mdl this register is a part of the 32-bit multiply/divide register which is implicitly used by the cpu when it performs a multiplication or a division. after multiplication, this non-bit addressable register represents the low order 16 bits of the 32-bit result. for long division, the mdl register must be loaded with the low order 16 bits of the 32-bit dividend before the division is started. after any division, the mdl register represents the 16-bit quotient. bit function mdh specifies the high order 16 bits of the 32-bit multiply and divide register md. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw mdh
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 54 micronas mdl reset value: 0000 h whenever this register is updated via software, the multiply/divide register in use (mdriu) flag in the multiply/divide control register (mdc) is set to ? 1 ? . the mdriu flag is cleared whenever the mdl register is read via software. when multiplication or division is interrupted before its completion and when a new multiply or divide operation is to be performed within the interrupt service routine, the mdl register must be saved along with the mdh and mdc registers to avoid erroneous results. the multiply/divide control register mdc this bit addressable 16-bit register is implicitly used by the cpu when it performs multiplication or division. it is used to store the required control information for the corresponding multiply or divide operations. the mdc register is updated by hardware during each single cycle of a multiply or divide instruction. mdc reset value: 0000 h when division or multiplication is interrupted before its completion and the multiply/divide unit is required, the mdc register must first be saved along with the mdh and mdl bit function mdl specifies the low order 16 bits of the 32-bit multiply and divide register md. bit function mdriu multiply/divide register in use ? 0 ? : cleared, when register mdl is read via software. ? 1 ? : set when the mdl or mdh register is written via software, or when a multiply or divide instruction is executed. !! internal machine status the multiply/divide unit uses these bits to control internal operations. never modify these bits without saving and restoring the mdc register. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw mdl - !! - 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 - r(w) - - - - -- - - !! !! !! !! !! !! - - - - r(w) r(w) r(w) r(w) r(w) r(w) r(w) mdr iu
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 55 micronas registers (to be able to restart the interrupted operation later), and then it must be cleared to prepare it for the new calculation. after the completion of the new division or multiplication the state of the interrupted multiply or divide operation must be restored. the mdriu flag is the only portion of the mdc register which might be of interest to the user. the remaining portions of the mdc register are reserved for dedicated use by the hardware, and should never be modified by the user in any way other than described above. otherwise a correct continuation of an interrupted multiply or divide operation cannot be guaranteed. the constant zeros register zeros all bits of this bit-addressable register are fixed to ? 0 ? by hardware. this register can be read only. the zeros register can be used as a register-addressable constant of all zeros, i.e. for bit manipulation or mask generation. it can be accessed via any instruction which is capable of addressing an sfr. zeros reset value: 0000 h the constant ones register ones all bits of this bit-addressable register are fixed to ? 1 ? by hardware. this register can be read only. the ones register can be used as a register-addressable constant of all ones, i.e. for bit manipulation or mask generation. it can be accessed via any instruction which is capable of addressing an sfr. ones (ff1e h / 8f h ) reset value: ffff h note: register syscon cannot be changed after execution of the einit instruction. identification register block all new derivatives of 16-bit microcontrollers provide a set of identification registers that offer information on the hw-status of the chip.the id registers are read only registers. they are placed in the extended sfr area. 0 0 0 0 0 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r r r r r r 00 0 r 0 0 0 0 0 0 0 0 r r r r r r r r r 1 1 1 1 1 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r r r r r r 11 1 r 1 1 1 1 1 1 1 1 r r r r r r r r r
sda 6000 preliminary data sheet version 2.1 c16x microcontroller 4 - 56 micronas idchip idmanuf bit function chiprevnu (7 ? 0) device revision code identifies the device step where the first release is marked ? 01 h ? . chipid (7 ? 0) device identification identifies the device name. bit function manuf jedec normalized manufacturer code 0c1 h : infineon technologies 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r r chipid(7..0) chiprevnu(7..0) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r manuf - - - -
interrupt and trap function
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 3 micronas 5 interrupt and trap functions the c166 architecture supports several mechanisms for fast and flexible response to service requests that can be generated from various sources either by the cpu itself or external, i.e. peripherals connected to the xbus or the pd bus. these mechanisms include: normal interrupt processing the cpu temporarily suspends the current program execution and branches to an interrupt service routine in order to service an interrupt requesting device. the current program status (ip, psw, also csp in segmentation mode) is saved on the internal system stack. a prioritization scheme with 16 priority levels allows the user to specify the order in which multiple interrupt requests are to be handled. interrupt processing via the peripheral event controller (pec) a faster alternative to normal software controlled interrupt processing is to service an interrupt requesting device with the integrated peripheral event controller (pec). triggered by an interrupt request, the pec performs a single word or byte data transfer between any two locations in the whole memory space through one of nine programmable pec service channels. during a pec transfer the normal program execution of the cpu is halted for just 1 instruction cycle. no internal program status information needs to be saved. the same prioritization scheme is used for pec service as for normal interrupt processing. pec transfers share the 2 highest priority levels. m2 enhances the functionalities of the original c166 pec with the following features:  pec range extended to the entire memory space,  new chaining mechanism between pairs of pec channels. trap functions trap functions are activated in response to special conditions that occur during the execution of instructions. several hardware trap functions are provided for handling erroneous conditions and exceptions that arise during the execution of an instruction. hardware traps always have highest priority and cause immediate system reaction. the software trap function is invoked by the trap instruction, which generates a software interrupt for a specified interrupt vector. for all types of traps the current program status is saved on the system stack.
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 4 micronas 5.1 interrupt system structure m2 provides up to 33 separate interrupt nodes that may be assigned to 16 priority levels. each node is associated with an interrupt input line in the interrupt system interface of the cpu. in order to support modular and consistent software design techniques, all interrupt nodes are supplied with a separate interrupt control register and interrupt vector. the control register contains the interrupt request flag, the interrupt enable bit, and the interrupt priority of the associated node. the c166 architecture provides a vectored interrupt system. in this system specific vector locations in the memory space are reserved for the reset, trap, and interrupt service functions. whenever a request occurs, the cpu branches to the location that is associated with the respective interrupt source. this allows direct identification of the source that caused the request. the only exceptions are the class b hardware traps, which all share the same interrupt vector. the status flags in the trap flag register (tfr) can then be used to determine which exception caused the trap. for the special software trap instruction, the vector address is specified by the operand field of the instruction, which is a seven bit trap number. the reserved vector locations build a jump table in the low end of the address space (segment 0). the jump table is made up of the appropriate jump instructions that transfer control to the interrupt or trap service routines, which may be located anywhere within the address space. the entries of the jump table are located at the lowest addresses in code segment 0 of the address space. each entry occupies 2 words, except for the reset vector and the hardware trap vectors which occupy 4 or 8 words. 5.1.1 interrupt allocation table m2 provides 33 separate interrupt nodes that may be assigned to 16 priority levels. in addition to the standard peripheral and external interrupts, there are some teletext related interrupts which support the realtime processing of the sliced data and the generation of the graphical data. its fast external interrupt inputs are sampled every 3 ns and are even able to recognize very short external signals. the table 5-1 lists all sources that are capable of requesting interrupt or pec service in m2, the associated interrupt vectors, their locations and the associated trap numbers. it also lists the mnemonics of the affected interrupt request flags and their corresponding interrupt enable flags. the mnemonics are composed of a part that specifies the respective source, followed by a part that specifies their function (ir = interrupt request flag, ie = interrupt enable flag).
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 5 micronas table 5-1 interrupt allocation table source of interrupt or pec service request interrupt control register address of control register interrupt vector location trap number external interrupt 0 ex0ic 00 ? ff88 h 00 ? 0060 h 18 h /24 d external interrupt 1 ex1ic 00 ? ff8a h 00 ? 0064 h 19 h /25 d external interrupt 2 ex2ic 00 ? ff8c h 00 ? 0068 h 1a h /26 d external interrupt 3 ex3ic 00 ? ff8e h 00 ? 006c h 1b h /27 d external interrupt 4 ex4ic 00 ? ff90 h 00 ? 0070 h 1c h /28 d external interrupt 5 ex5ic 00 ? ff92 h 00 ? 0074 h 1d h /29 d external interrupt 6 ex6ic 00 ? ff94 h 00 ? 0078 h 1e h /30 d external interrupt 7 ex7ic 00 ? ff96 h 00 ? 007c h 1f h /31 d gpt1 timer 2 t2ic 00 ? ff60 h 00 ? 0088 h 22 h /34 d gpt1 timer 3 t3ic 00 ? ff62 h 00 ? 008c h 23 h /35 d gpt1 timer 4 t4ic 00 ? ff64 h 00 ? 0090 h 24 h /36 d gpt2 timer 5 t5ic 00 ? ff66 h 00 ? 0094 h 25 h /37 d gpt2 timer 6 t6ic 00 ? ff68 h 00 ? 0098 h 26 h /38 d gpt2 caprel register cric 00 ? ff6a h 00 ? 009c h 27 h /39 d a/d1 conversion complete adc1ic 00 ? ff98 h 00 ? 00a0 h 28 h /40 d a/d2 conversion complete adc2ic 00 ? ff9a h 00 ? 00a4 h 29 h /40 d asc0 transmit s0tic 00 ? ff6c h 00 ? 00a8 h 2a h /42 d asc0 transmit buffer s0tbic 00 ? f19c h 00 ? 011c h 47 h /71 d asc0 receive s0ric 00 ? ff6e h 00 ? 00ac h 2b h /43 d asc0 autobaud detection start abstaic 00 ? ff9e h 00 ? 0084 h 21 h /33 d asc0 autobaud detection stop abstoic 00 ? f17a h 00 ? 00f4 h 3d h /61 d asc0 error s0eic 00 ? ff70 h 00 ? 00b0 h 2c h /44 d ssc transmit ssctic 00 ? ff72 h 00 ? 00b4 h 2d h /45 d ssc receive sscric 00 ? ff74 h 00 ? 00b8 h 2e h /46 d ssc error ssceic 00 ? ff76 h 00 ? 00bc h 2fh/47 d i 2 c data transfer event i 2 ctic 00 ? f194 h 00 ? 0118 h 46 h /70 d i 2 c protocol event i 2 cpic 00 ? f18c h 00 ? 0114 h 45 h /69 d i 2 c transmission end event i 2 cteic 00 ? f184 h 00 ? 0110 h 44 h /68 d
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 6 micronas note: each entry of the interrupt vector table provides room for two word instructions or one doubleword instruction. the respective vector location results from multiplying the trap number by 4 (4 bytes per entry). note: * = interrupts relevant for acquisition and graphic support. 5.1.2 hardware traps the table 5-2 lists the vector locations for hardware traps and the corresponding status flags in the tfr register. it also lists the priorities of trap service for cases where more than one trap condition might be detected within the same instruction. after any reset, program execution starts at the reset vector at location 00 ? 0000 h . reset conditions have priority over every other system activity and therefore have the highest priority (trap priority iv). software traps may be initiated to any vector location between 00 ? 0000 h and 00 ? 01fc h . a service routine entered via a software trap instruction is always executed on the current cpu priority level which is indicated in bit field ilvl in register psw. this means that routines entered via the software trap instruction can be interrupted by all hardware traps or higher level interrupt requests. adc wake up adwic 00 ? f178 h 00 ? 00f0 h 3c h /60 d acq interrupt * acqic 00 ? f176 h 00 ? 00ec h 3b h /59 d display vertical sync * vsdisic 00 ? f174 h 00 ? 00e8 h 3a h /58 d display horizontal sync * hsdisic 00 ? f172 h 00 ? 00e4 h 39 h /57 d graphic acc. finished * gafic 00 ? ff9c h 00 ? 0080 h 20 h /32 d realtime clock rtcic 00 ? f19e h 00 ? 010c h 43 h /67 d pecc link irq pecclic 00 ? f180 h 00 ? 004c h 4c h /76 d table 5-1 interrupt allocation table (cont ? d) source of interrupt or pec service request interrupt control register address of control register interrupt vector location trap number
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 7 micronas normal interrupt processing and pec service during each instruction cycle one out of all sources which require pec or interrupt processing is selected according to its interrupt priority. this prioritization of interrupts and pec requests is programmable in two levels. each requesting source can be assigned to a specific priority. a second level (called ? group priority ? ) allows the specification of an internal order for simultaneous requests from a group of different sources on the same priority level. at the end of each instruction cycle the one source request with the highest current priority will be determined by the interrupt system. this request will then be serviced if its priority is higher than the current cpu priority in the psw register. table 5-2 exception condition trap flag trap vector vector location trap number trap priority reset functions: hardware reset software reset watchdog timer overflow ? reset reset reset 00 ? 0000 h 00 ? 0000 h 00 ? 0000 h 00 h 00 h 00 h iv iv iv debug hardware trap debug dtrap 00 ? 0020 h 08 h iii class a hardware traps: non-maskable interrupt stack overflow stack underflow nmi stkof stkuf nmitrap stotrap stutrap 00 ? 0008 h 00 ? 0010 h 00 ? 0018 h 02 h 04 h 06 h ii ii ii class b hardware traps: undefined opcode protected instruction fault illegal word operand access illegal instruction access illegal external bus access undopc prtflt illopa illina illbus btrap btrap btrap btrap btrap 00 ? 0028 h 00 ? 0028 h 00 ? 0028 h 00 ? 0028 h 00 ? 0028 h 0a h 0a h 0a h 0a h 0a h i i i i i reserved ?? [2c h ? 3c h ][0b h ? 0f h ] ? software traps trap instruction ?? any [00 ? 0000 h ? 00 ? 01fc h ] in steps of 4 h any [00 h ? 7f h ] current cpu priority
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 8 micronas interrupt system register description interrupt processing is controlled globally by the psw register through a general interrupt enable bit (ien) and the cpu priority field (ilvl). additionally the different interrupt sources are controlled individually by their specific interrupt control registers ( ? ic). thus, the acceptance of requests by the cpu is determined by both the individual interrupt control registers and the psw. pec services are controlled by the respective peccx register and the source and destination pointers, which specify the task of the respective pec service channel. interrupt control registers all interrupt control registers are organized identically. the lower 8 bits of an interrupt control register contain the complete interrupt status information of the associated source which is required during one round of prioritization; the upper 8 bits of the respective register are reserved. all interrupt control registers are bit-addressable and all bits can be read or written via software. this allows each interrupt source to be programmed or modified with just one instruction. when accessing interrupt control registers through instructions which operate on word data types, their upper 8 bits (15 ? 8) will return zeros when read, and will discard written data. note: the layout of the interrupt control registers shown below applies to each xxic register, where xx stands for the mnemonic for the respective source. interrupt node sharing the interrupt controller of m2 can be configured to control up to 33 different sources. if there is a need for a greater number of interrupt sources to be managed, interrupt requests may share the same interrupt node. in this case, all the sources on the same node share the priority level defined by the corresponding interrupt control register xxic and may be globally enabled/disabled by the ie bit of this register. arbitration between sources connected to the same node must be performed by the interrupt handler associated with this node. for low rate requests, the software overhead is not critical.
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 9 micronas xxic reset value: - - 00 h the interrupt request flag is set by hardware whenever a service request from the respective source occurs. it is cleared automatically upon entry into the interrupt service routine or upon a pec service. in the case of pec service, the interrupt request flag remains set if the count field in register peccx of the selected pec channel decrements to zero. this allows a normal cpu interrupt to respond to a completed pec block transfer. note: modifying the interrupt request flag via software causes the same effect as if it had been set or cleared by hardware. interrupt priority level and group level the four bits of an ilvl bit field specify the priority level of a service request for the arbitration of simultaneous requests. the priority increases with the numerical value of ilvl, so 0000 b is the lowest and 1111 b is the highest priority level. when more than one interrupt request on a specific level becomes active at the same time, the values in the respective glvl bit fields are used for second level arbitration to select one request for servicing. again the group priority increases with the numerical value of glvl, so 00 b is the lowest and 11 b is the highest group priority. bit function glvl group level defines the internal order for simultaneous requests of the same priority. 3: highest group priority 0: lowest group priority ilvl interrupt priority level defines the priority level for the arbitration of requests. f h : highest priority level 0 h : lowest priority level xxie interrupt enable control bit (individually enables/disables a specific source) ? 0 ? : interrupt request is disabled ? 1 ? : interrupt request is enabled xxir interrupt request flag ? 0 ? : no request pending ? 1 ? : this source has raised an interrupt request 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw - - - - rw rw - - - - xxie xxir glvl ilvl
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 10 micronas note: all interrupt request sources that are enabled and programmed to the same priority level must always be programmed to different group priorities. otherwise an incorrect interrupt vector will be generated. upon entry into the interrupt service routine the priority level of the source that won the arbitration and who ? s priority level is higher than the current cpu level, is copied into the ilvl bit field of register psw after pushing the old psw contents onto the stack. the interrupt system of m2 allows nesting of up to 15 interrupt service routines of different priority levels (level 0 cannot be arbitrated). interrupt requests that are programmed to priority levels 15 or 14 (i.e., ilvl = 111x b ) will be serviced by the pec unless the count field of the associated pecc register contains zero. in this case the request will instead be serviced by normal interrupt processing. interrupt requests that are programmed to priority levels 13 through 1 will always be serviced by normal interrupt processing. note: priority level 0000 b is the default level of the cpu. therefore a request on level 0 will never be serviced, because it can never interrupt the cpu. however, an enabled interrupt request on level 0000 b will terminate the idle mode and reactivate the cpu. for interrupt requests which are to be serviced by the pec, the associated pec channel number is derived from the respective ilvl (lsb) and glvl (see figure 5-1 ). so programming a source to priority level 15 (ilvl = 1111 b ) selects the pec channel group 7 ? 4, programming a source to priority level 14 (ilvl = 1110 b ) selects the pec channel group 3 ? 0. the actual pec channel number is then determined by the glvl group priority field. figure 5-1 priority levels and pec channels simultaneous requests for pec channels are prioritized according to the pec channel number, where channel 0 has lowest and channel 8 has highest priority. note: all sources that request pec service must be programmed to different pec channels. otherwise an incorrect pec channel may be activated. pec control interrupt control register ilvl ued11127 pec channel # glvl
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 11 micronas the table below shows a few examples of each action executed with each particular programming of an interrupt control register. note: all requests on levels 13 ? 1 cannot initiate pec transfers. they are always serviced by an interrupt service routine. no pecc register is associated and no count field is checked. interrupt control functions in the psw the processor status word (psw) is functionally divided into 2 parts: the lower byte of the psw basically represents the arithmetic status of the cpu, the upper byte of the psw controls the interrupt system of m2 and the arbitration mechanism for the external bus interface. note: pipeline effects have to be considered when enabling/disabling interrupt requests via modifications of register psw. priority level type of service ilvl glvl count = 00 h count ? 00 h 1 1 1 11 1 cpu interrupt, level 15, group priority 3 pec service, channel 7 1 1 1 11 0 cpu interrupt, level 15, group priority 2 pec service, channel 6 1 1 1 01 0 cpu interrupt, level 14, group priority 2 pec service, channel 2 1 1 0 1 1 0 cpu interrupt, level 13, group priority 2 cpu interrupt, level 13, group priority 2 0 0 0 1 1 1 cpu interrupt, level 1, group priority 3 cpu interrupt, level 1, group priority 3 0 0 0 1 0 0 cpu interrupt, level 1, group priority 0 cpu interrupt, level 1, group priority 0 0 0 0 0 x x no service! no service!
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 12 micronas psw reset value: 0000 h cpu priority ilvl defines the current level for the operation of the cpu. this bit field reflects the priority level of the routine that is currently being executed. upon entry into an interrupt service routine, this bit field is updated with the priority level of the request that is being serviced. the psw is saved on the system stack before. the cpu level determines the minimum interrupt priority level that will be serviced. any request on the same or lower level will not be acknowledged. the current cpu priority level may be adjusted via software, to control which interrupt request sources will be acknowledged. pec transfers do not really interrupt the cpu, but rather ? steal ? a single cycle, so pec services do not influence the ilvl field in the psw. hardware traps switch the cpu level to maximum priority (i.e. 15) so no interrupt or pec requests will be acknowledged while an exception trap service routine is being executed. note: the trap instruction does not change the cpu level, so software invoked trap service routines may be interrupted by higher requests. interrupt enable bit ien globally enables or disables pec operations and the acceptance of interrupts by the cpu. when ien is cleared, no new interrupt requests are bit function n, c, v, z, e, mulip, usr0 cpu status flags (described in chapter 4.6 ) define the current status of the cpu (alu, multiplication unit). hlden hold enable (enables external bus arbitration) 0: bus arbitration disabled, p6.7 ... p6.5 may be used for general purpose io 1: bus arbitration enabled, p6.7 ... p6.5 serve as breq , hlda , hold , resp. ilvl cpu priority level defines the current priority level for the cpu f h : highest priority level 0 h : lowest priority level ien interrupt enable control bit (globally enables/disables interrupt requests) ? 0 ? : interrupt requests are disabled ? 1 ? : interrupt requests are enabled hld en - mul ip usr0 n zc v e 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw - rw rw rw - rw - rw ien - - ilvl rw
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 13 micronas accepted by the cpu. however requests that have already entered the pipeline at that time will be processed. when ien is set to ? 1 ? , all interrupt sources, which have been individually enabled by the interrupt enable bits in their associated control registers, are globally enabled. note: traps are non-maskable and are therefore not affected by the ien bit.
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 14 micronas 5.2 operation of the pec channels m2 ? s peripheral event controller (pec) provides 8 pec service channels, which move a single byte or word between two locations in the entire memory space. packet transfers are provided with channels 0 and 1. this is the fastest possible interrupt response and in many cases is sufficient to service the respective peripheral request (e.g. serial channels, etc.). each channel is controlled by a dedicated pec channel counter/control register (peccx) and a pair of pointers for the source (srcpx) and destination (dstpx) of the data transfer. the pecc registers control the action that is performed by the respective pec channel. compared to existing c16x architectures, the pec transfer function is enhanced by extended functionality. the extended pec functions are defined as follows:  source pointer and destination pointer are extended to 24-bit pointer, thus enabling pec controlled data transfers between any two locations within the total address space. both 8-bit segment numbers of every source/destination pointer pair are defined in one 16-bit sfr register; thus, 8 pec segment number registers are available for the 8 pec channels.  for every two channels a chaining feature is provided. when enabled in the pec control register, a termination interrupt of one channel will automatically switch transfer control to the other channel of the channel pair. extended pec channel control the pec control registers with the extended functionality and their application for new pec control are defined as follows: peccx reset value: 0000 h bit function count (7 ? 0) pec transfer count counts pec transfers (bytes or words) and influences the channel ? s action. bwt byte / word transfer selection 0: transfer a word. 1: transfer a byte. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw - - - clt cl inc(1..0) bwt count (7...0) rw rw rw
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 15 micronas byte/word transfer bit bwt controls, if a byte or a word is moved during a pec service cycle. this selection controls the transferred data size and the increment step for the modified pointer. increment control field inc controls, if one of the pec pointers is incremented after the pec transfer. however, it is not possible to increment both pointers. if the pointers are not modified (inc = ? 00 ? ) the respective channel will always move data from the same source to the same destination. note: the reserved combination ? 11 ? is changed to ? 10 ? by hardware. however, it is not recommended to use this combination. the pec transfer count field count controls the action of a respective pec channel, where the content of bit field count, at the time the request is activated, selects the action. count may allow a specified number of pec transfers, unlimited transfers or no pec service at all. the table below summarizes, how the count field itself, the interrupt requests flag ir and the pec channel action depends on the previous content of count. inc(1 ? 0) increment control (modification of srcpx or dstpx) 0 0: pointers are not modified. 0 1: increment dstpx by 1 or 2. 1 0: increment srcpx by 1 or 2. 1 1: reserved. do not use this combination. cl channel link control 0: pec channels work independent 1: pairs of channels are linked together clt channel link toggle state 0: even numbered pec channel of linked channels active 1: odd numbered pec channel of linked channels active table 5-3 pec control register addresses register address reg. space register address reg. space pecc0 fec0 h / 60 h sfr pecc4 fec8 h / 64 h sfr pecc1 fec2 h / 61 h sfr pecc5 feca h / 65 h sfr pecc2 fec4 h / 62 h sfr pecc6 fecc h / 66 h sfr pecc3 fec6 h / 63 h sfr pecc7 fece h / 67 h sfr bit function
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 16 micronas the pec transfer counter allows the servicing of a specified number of requests by the respective pec channel, and then (when count reaches 00 h ) activates the interrupt service routine, which is associated with the priority level. after each pec transfer the count field is decremented and the request flag is cleared to indicate that the request has been serviced. continuous transfers are selected by the value ff h in bit field count. in this case count is not modified and the respective pec channel services any request until it is disabled again. when count is decremented from 01 h to 00 h after a transfer the request flag is not cleared, which generates another request from the same source. when count already contains the value 00 h , the respective pec channel remains idle and the associated interrupt service routine is activated instead. this provides a choice if a level 15 or 14 request is to be serviced by the pec or by the interrupt service routine. note: pec transfers are only executed if their priority level is higher than the cpu level, i.e. only pec channels 7 ? 4 are processed, while the cpu executes on level 14. all interrupt request sources that are enabled and programmed for pec service should use different channels. otherwise only one transfer will be performed for all simultaneous requests. when count is decremented to 00 h , and the cpu is interrupted, an incorrect interrupt vector will be generated. channel link mode for data chaining data chaining with linked pec channels is enabled if the channel link control bit in peccx register is set to ? 1 ? either in one or both pec channel control registers of a channel pair. in this case, two pec channels are linked together and handle chained block transfers alternatively to each other. the whole data transfer is divided into several block transfers where each block is controlled by one pec channel of a channel pair. previous count modified count ir after pec service action of pec channel and comments ff h ff h ? 0 ? move a byte / word continuous transfer mode, i.e. count is not modified fe h ? 02 h fd h ? 01 h ? 0 ? move a byte / word and decrement count 01 h 00 h ? 1 ? move a byte / word leave request flag set, which triggers another request 00 h 00 h ( ? 1 ? ) no action! activate interrupt service routine rather than pec channel.
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 17 micronas when a data block is completely transferred a channel link interrupt is generated and the pec service request processing is automatically switched to the ? other ? pec channel of the channel-pair. thus, pec service requests addressed to a linked pec channel are either handled by linked pec channel a or by linked pec channel b. this channel toggle allows the setting up of shadow and multiple buffers for pec transfers by changing pointer and count values of one channel while the other channel is active. the following table lists the channels that can be linked together, and the channel numbers to address the linked channels. for each pair of linked channels an internal channel flag, the channel link toggle flag clt, identifies which of the two pec channels will serve the next pec request. the clt flag is indicated in both peccx registers of the two linked pec channels, where the clt bit in channel b is always inverse to the clt bit in channel a. the very first transfer is always started with the channel a if the clt bit is not otherwise programmed before. the clt bit is only valid in the case of linked pec channels, indicated by the cl bits of linked channels. if linking is not enabled, the clt bit of both channels is always zero. the internal channel link flag clt toggles, and the other channel begins servicing with the next request if the ? old ? channel stops the service (count = 0), and if the new channel has in its pec control register the enabled cl flag and if its transfer count is more than zero. note: with the last transfer of a block transfer (count = 0), the channel link control flag cl of that channel is cleared in its peccx register. if the cl channel link flag of the new (chained) pec control register is found to be zero, the whole data transfer is finished and the channel link interrupt is coincidentally a termination interrupt. the channel link mode is finished and the internal channel toggle flag is cleared after the last transfer of the block, if the cl flags of both pair channels are cleared. additional interrupt request node for channel link interrupts the pec unit has one dedicated service request node (trap number) for all channel link interrupts. this service request node requests cpu interrupt service in case of one or more channel link request flags and the respective enable control bit being set in the channel link interrupt subnode control register (clisnc). these flags indicate a channel linked pec channels linked pec channel pec channel a pec channel b channel 0 channel 1 channel 0 channel 2 channel 3 channel 2 channel 4 channel 5 channel 4 channel 6 channel 7 channel 6
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 18 micronas link interrupt condition of linked pec channels (a and b channels) which requires support from the cpu. the following channel link interrupt conditions requesting cpu service are possible:  in single transfer mode a count value change from 01 h to 00 h in a linked pec channel and cl flag is set in the respective pec control register. in this case the cpu service is requested to update the pec control and pointer registers while the next block transfer is executed (the whole transfer is divided into separately controlled block transfers). the last block transfer is determined by the missing link bit in the new (linked) pec control register. if a new service request hits a linked channel with count equal to zero and channel link flag disabled, a standard interrupt, as known from standard pec channels, is performed. the channel link interrupt subnode register clisnc is defined as follows: clisnc reset value: 0000 h the source and destination pointers specifiy the locations between which the data is to be moved. pec transfers can be performed between any locations in the entire memory space of the m2. for each of the 8 pec channels, the source and destination addresses are specified by a 8-bit segment number and a 16-bit offset. the source and destination segment numbers, respectively pecssn and pecdsn, are stored in a sfr associated with each channel (pecsnx, see description below). the offset pointers for the source and destination address do not reside in specific sfrs, but are mapped into the internal ram of the m2 just below the bit-addressable area (see figure 5-2 ). bit function xxie pec channel link interrupt enable control bit (individually enables/disables a specific channel pair interrupt request) ? 0 ? : pec interrupt request is disabled ? 1 ? : pec interrupt request is enabled xxir pec channel service request flag ? 0 ? : no channel link service request pending ? 1 ? : this source (channel pair) has raised an request to service a pec channel after channel linking 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw rw rw - - c6 ir c6 ie - - c4 ir c4 ie - - c2 ir c2 ie - - c0 ir c0 ie
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 19 micronas figure 5-2 mapping of pec offset pointers into the internal ram the pointer locations for inactive pec channels may be used for general data storage. only the required pointers occupy ram locations. pecsnx reset value: 0000 h bit function pecssn (7 ? 0) pec source segment number 8-bit segment number (address bits a23 ? 16) used for addressing the source of the respective pec transfer. pecdsn (7 ? 0) pec destination segment number 8-bit segment number (address bits a23 ? 16) used for addressing the destination of the respective pec transfer. ued11128 00 ? fcfe h dstp7 srcp7 00 ? fcfc h dstp6 00 ? fcfa h srcp6 00 ? fcf8 h dstp5 00 ? fcf6 h srcp5 00 ? fcf4 h dstp4 00 ? fcf2 h srcp4 00 ? fcf0 h 00 ? fce2 dstp0 h srcp0 h 00 ? fce0 srcp1 dstp1 srcp2 dstp2 srcp3 dstp3 h h h h 00 ? fce8 00 ? fce4 00 ? fce6 00 ? fcec 00 ? fcea 00 ? fcee h h 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw pecdsn (7...0) pecssn (7...0)
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 20 micronas if a word data transfer is selected for a specific pec channel (i.e. bwt = ? 0 ? ), the respective source and destination pointers must both contain a valid word address which points to an even byte boundary. otherwise the illegal word access trap will be invoked when this channel is used. 5.2.1 prioritization of interrupt and pec service requests interrupt and pec service requests from all sources can be enabled so they are arbitrated and serviced (if they win), or they may be disabled so their requests are disregarded and not serviced. enabling and disabling interrupt requests may be done via three mechanisms: control bits allow the switching of each individual source to ? on ? or ? off ? so that it may generate a request or not. the control bits (xxie) are located in the respective interrupt control registers. all interrupt requests can generally be enabled or disabled via the ien bit in register psw. this control bit is the ? main switch ? that selects whether requests from any source are accepted or not. for a specific request to be arbitrated the respective source ? s enable bit and the global enable bit must both be set. the priority level automatically selects a certain group of interrupt requests that will be acknowledged, disclosing all other requests. the priority level of the source that won the arbitration is compared with the cpu ? s current level and the source is only serviced if its level is higher than the current cpu level. changing the cpu level to a specific value via software blocks all requests on the same or a lower level. an interrupt source that is assigned to level 0 will be disabled and never be serviced. the atomic and extend instructions automatically disable all interrupt requests for the duration of the following 1 ? 4 instructions. this is useful e.g. for semaphore handling and does not require re-enabling the interrupt system after the inseparable instruction sequence. interrupt class management an interrupt class covers a set of interrupt sources with the same importance, i.e. the same priority from the system ? s viewpoint. interrupts of the same class must not interrupt each other. m2 supports this function with two features: table 5-4 pec segment number register addresses register address reg. space register address reg. space pecsn0 fed0 h / 68 h sfr pecsn4 fed8 h / 6c h sfr pecsn1 fed2 h / 69 h sfr pecsn5 feda h / 6d h sfr pecsn2 fed4 h / 6a h sfr pecsn6 fedc h / 6e h sfr pecsn3 fed6 h / 6b h sfr pecsn7 fede h / 6f h sfr
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 21 micronas classes with up to 4 members can be established by using the same interrupt priority (ilvl) and assigning a dedicated group level (glvl) to each member. this functionality is built-in and handled automatically by the interrupt controller. classes with more than 4 members can be established by using a number of adjacent interrupt priorities (ilvl) and the respective group levels (4 per ilvl). each interrupt service routine within this class sets the cpu level to the highest interrupt priority within the class. all requests from the same or any lower level are blocked now, i.e. no request of this class will be accepted. the example below establishes 3 interrupt classes which cover 2 or 3 interrupt priorities, depending on the number of members in a class. a level 6 interrupt disables all other sources in class 2 by changing the current cpu level to 8, which is the highest priority (ilvl) in class 2. class 1 requests or pec requests are still serviced in this case. the 24 interrupt sources (excluding pec requests) are assigned to 3 classes of priority rather than to 7 different levels, as the hardware support would do. table 5-5 software controlled interrupt classes (example) ilvl (priority glvl interpretation 3210 15 pec service on up to 8 channels 14 13 12 xxxxinterrupt class 1 5 sources on 2 levels 11 x 10 9 8 xxxxinterrupt class 2 9 sources on 3 levels 7 xxxx 6x 5 xxxxinterrupt class 3 5 sources on 2 levels 4x 3 2 1 0 no service!
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 22 micronas 5.2.2 saving the status during interrupt service before an interrupt request that has been arbitrated is actually serviced, the status of the current task is automatically saved on the system stack. the cpu status (psw) is saved along with the location, where the execution of the interrupted task is resumed after returning from the service routine. this return location is specified through the instruction pointer (ip) and, in case of a segmented memory model, the code segment pointer (csp). bit sgtdis in register syscon controls how the return location is stored. the system stack first receives the psw, followed by the ip (unsegmented) or the csp and then ip (segmented mode). this optimizes the usage of the system stack, if segmentation is disabled. the cpu priority field (ilvl in psw) is updated with the priority of the interrupt request that is to be serviced, so the cpu now executes on the new level. if multiplication or division was in progress at the time the interrupt request was acknowledged bit mulip in register psw is set to ? 1 ? . in this case the return location that is saved on the stack is not the next instruction in the instruction flow, but rather the multiply or divide instruction itself, as this instruction has been interrupted and will be completed after returning from the service routine. figure 5-3 task status saved on the system stack the interrupt request flag of the source that is being serviced is cleared. the ip is loaded with the vector associated with the requesting source (the csp is cleared in case of segmentation) and the first instruction of the service routine is fetched from the respective vector location, which is expected to branch to the service routine itself. the data page pointers and the context pointer are not affected.
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 23 micronas when the interrupt service routine is left (reti is executed), the status information is popped from the system stack in reverse order, taking into account the value of bit sgtdis. context switching an interrupt service routine usually saves all the registers it uses on the stack, and restores them before returning. the more registers a routine uses, the more time is wasted with saving and restoring. the m2 allows the complete bank of cpu registers (gprs) to switch with a single instruction, so the service routine executes within its own, separate context. the instruction ? scxt cp, #new_bank ? pushes the contents of the context pointer (cp) on the system stack and loads cp with the immediate value ? new_bank ? , which selects a new register bank. the service routine may now use its ? own registers ? . this register bank is preserved when the service routine terminates, i.e. its contents are available on the next call. before returning (reti) the previous cp is simply popped from the system stack, which returns the registers to the original bank. note: the first instruction following the scxt instruction must not use a gpr. resources that are used by the interrupting program must eventually be saved and restored, e.g. the dpps and the registers of the mul/div unit. 5.2.3 interrupt response times the interrupt response time defines the time from an interrupt request flag of an enabled interrupt source being set until the first instruction (i1) is fetched from the interrupt vector location. the basic interrupt response time for the m2 is 3 instruction cycles. figure 5-4 pipeline diagram for interrupt response time ued11129 ir-flag 0 1 interrupt response time pipeline stage fetch decode execute writeback cycle 1 cycle 2 cycle 3 cycle 4 n n - 1 n - 2 n - 3 n + 1 n n - 1 n - 2 n + 2 trap (1) n n - 1 i1 trap (2) trap n
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 24 micronas all instructions in the pipeline, including instruction n (during which the interrupt request flag is set), are completed before entering the service routine. the actual execution time for these instructions (e.g. wait-states) therefore influences the interrupt response time. in figure 5-4 the respective interrupt request flag is set in cycle 1 (the fetching of instruction n). the indicated source wins the prioritization round (during cycle 2). in cycle 3 a trap instruction is injected into the decode stage of the pipeline, replacing instruction n+1 and clearing the source's interrupt request flag to ? 0 ? . cycle 4 completes the injected trap instruction (save psw, ip and csp, if in segmented mode) and fetches the first instruction (i1) from the respective vector location. all instructions that entered the pipeline, after the setting of the interrupt request flag (n+1, n+2), will be executed after returning from the interrupt service routine. the minimum interrupt response time is 5 states (10 tcl). this requires program execution from the internal code memory, no external operand read requests and setting the interrupt request flag during the last state of an instruction cycle. when the interrupt request flag is set during the first state of an instruction cycle, the minimum interrupt response time under these conditions is 6 state times (12 tcl). the interrupt response time is increased by all delays of the instructions in the pipeline that are executed before entering the service routine (including n).  when internal hold conditions between instruction pairs n-2/n-1 or n-1/n occur, or when instruction n explicitly writes to the psw or the sp, the minimum interrupt response time may be extended by 1 state time for each of these conditions.  when instruction n reads an operand from the internal code memory, or when n is a call, return, trap, or mov rn, [rm+ #data16] instruction, the minimum interrupt response time may be extended by 2 state times during internal code memory program execution.  in case instruction n reads the psw and instruction n-1 effects the condition flags, the interrupt response time may be extended by 2 state times. the worst case interrupt response time during internal code memory program execution adds 12 state times (24 tcl). any reference to external locations increases the interrupt response time due to pipeline related access priorities. the following conditions have to be considered:  instruction fetch from an external location  operand read from an external location  result write-back to an external location there are a number of combinations depending on where the instructions, source and destination operands are located. note, however, that only access conflicts contribute to the delay. a few examples illustrate these delays:  the worst case interrupt response time, including external accesses, will occur when instructions n, n+1 and n+2 are executed out of external memory, instructions n-1
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 25 micronas and n require external operand read accesses, instructions n-3 through n write back external operands, and the interrupt vector also points to an external location. in this case the interrupt response time is the time needed to perform 9 word bus accesses, because instruction i1 cannot be fetched via the external bus until all write, fetch and read requests from preceding instructions in the pipeline are terminated.  when the interrupt vector, of the example above, is pointing into the internal code memory, the interrupt response time is 7 word bus accesses plus 2 states because the fetching of instruction i1 from internal code memory can start earlier.  when instructions n, n+1 and n+2 are executed out of the external memory and the interrupt vector points to an external location, but all operands for instructions n-3 through n are in internal memory, then the interrupt response time is the time needed to perform 3 word bus accesses.  when the interrupt vector, of the example above, is pointing into the internal code memory, the interrupt response time is 1 word bus access plus 4 states. after an interrupt service routine has been terminated by executing the reti instruction, and if further interrupts are pending, the next interrupt service routine will not be entered until at least two instruction cycles of the program that was interrupted have been executed. in most cases two instructions will be executed during this time. only one instruction will typically be executed if the first instruction following the reti instruction is a branch instruction (without cache hit), if it reads an operand from internal code memory, or if it is executed out of the internal ram. note: a bus access, in this context, includes all delays which can occur during an external bus cycle. 5.2.4 pec response times the pec response time defines the time between an interrupt request flag of an enabled interrupt source being set and the pec data transfer being started. the basic pec response time for the m2 is 2 instruction cycles.
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 26 micronas figure 5-5 pipeline diagram for pec response time in figure 5-5 , the respective interrupt request flag is set in cycle 1 (fetching instruction n). the indicated source wins the prioritization round (during cycle 2). in cycle 3 a pec transfer ? instruction ? is imported into the decode stage of the pipeline, suspending instruction n+1 and clearing the source ? s interrupt request flag to ? 0 ? . cycle 4 completes the imported pec transfer and resumes the execution of instruction n+1. all instructions that entered the pipeline after setting of the interrupt request flag (n+1, n+2) will be executed after the pec data transfer. note: when instruction n reads any of the pec control registers pecc7 ? pecc0, while a pec request wins the current round of prioritization, the round is repeated and the pec data transfer is started one cycle later. the minimum pec response time is 3 states (6 tcl). this requires program execution from the internal code memory, no external operand read requests and setting the interrupt request flag during the last state of an instruction cycle. when the interrupt request flag is set during the first state of an instruction cycle, the minimum pec response time under these conditions is 4 state times (8 tcl). the pec response time is increased by all delays of the instructions in the pipeline which are executed before starting the data transfer (including n).  when internal hold conditions between instruction pairs n-2/n-1 or n-1/n occur, the minimum pec response time may be extended by 1 state time for each of these conditions.  when instruction n reads an operand from the internal code memory, or when n is a call, return, trap, or mov rn, [rm+ #data16] instruction, the minimum pec response time may be extended by 2 state times during internal code memory program execution. ued11130 ir-flag 0 1 pec response time pipeline stage fetch decode execute writeback cycle 1 cycle 2 cycle 3 cycle 4 n n - 1 n - 2 n - 3 n + 1 n n - 1 n - 2 n + 2 pec n n - 1 n + 2 n + 1 pec n
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 27 micronas  if instruction n reads the psw and instruction n-1 effects the condition flags, the pec response time may additionally be extended by 2 state times. the worst case pec response time during internal code memory program execution adds to 9 state times (18 tcl). any reference to external locations increases the pec response time due to pipeline related access priorities. the following conditions have to be considered:  instruction fetch from an external location  operand read from an external location  result write-back to an external location there are a number of combinations depending on where the instructions, source and destination operands are located. note, however, that only access conflicts contribute to the delay. a few examples illustrate these delays:  the worst case interrupt response time, including external accesses, will occur when instructions n and n+1 are executed out of external memory, instructions n-1 and n require external operand read accesses and instructions n-3, n-2 and n-1 write back external operands. in this case the pec response time is the time needed to perform 7 word bus accesses.  when instructions n and n+1 are executed out of the external memory, but all operands for instructions n-3 through n-1 are in internal memory, then the pec response time is the time needed to perform 1 word bus access plus 2 state times. once a request for pec service has been acknowledged by the cpu, the execution of the next instruction is delayed by 2 state times plus the additional time it might take to fetch the source operand from internal code memory or external memory and to write the destination operand over the external bus in an external program environment. note: a bus access, in this context, includes all delays which can occur during an external bus cycle. for an epec request, the basic response time is 3 instruction cycles. the minimum response time is reached when the request occurs at the end of an instruction cycle. in this case the response time is 5 states (10 tcl). all the conditions described below that may increase the response time apply to the epec. 5.2.5 fast interrupts the interrupt inputs are sampled every 8 states (16 tcl), i.e. external events are scanned and detected in timeframes of 16 tcl. m2 provides 8 interrupt inputs that are sampled every 2 tcl, so external events are captured faster than with standard interrupt inputs.
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 28 micronas the 8 lines can be programmed individually to this fast interrupt mode, where the trigger transition (rising, falling or both) can also be selected. the external interrupt control register exicon controls this feature for all 8 signals. exicon (f1c0 h / e0 h ) reset value: 0000 h note: the fast external interrupt inputs are sampled every 2 tcl. the interrupt request arbitration and processing, however, is executed every 8 tcl. in sleep mode, no clock is available for sampling, but interrupt request detection is still possible on fast interrupt request lines using asynchronous logic. bit function exixes external interrupt x edge selection field (x = 7 ? 0) 0 0: fast external interrupts disabled: standard mode 0 1: interrupt on positive edge (rising) 1 0: interrupt on negative edge (falling) 1 1: interrupt on any edge (rising or falling) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw exi2es exi0es exi1es rw rw rw exi7es exi5es exi6es rw rw exi3es exi4es
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 29 micronas 5.3 trap functions traps interrupt the current execution similar to standard interrupts. however, trap functions offer the possibility to bypass the interrupt system ? s prioritization process in cases where immediate system reaction is required. trap functions are not maskable and always have priority over interrupt requests on any priority level. m2 provides two different kinds of trapping mechanisms. hardware traps are triggered by events that occur during program execution (e.g. illegal access or undefined opcode), software traps are initiated via an instruction within the current execution flow. software traps the trap instruction is used to cause a software call to an interrupt service routine. the trap number that is specified in the operand field of the trap instruction determines which vector location in the address range from 00 ? 0000 h through 00 ? 01fc h will be branched. executing a trap instruction causes a similar effect as if an interrupt at the same vector had occurred. psw, csp (in segmentation mode), and ip are pushed on the internal system stack and a jump is taken to the specified vector location. when segmentation is enabled and a trap is executed, the csp for the trap service routine is set to code segment 0. no interrupt request flags are affected by the trap instruction. the interrupt service routine called by a trap instruction must be terminated with a reti (return from interrupt) instruction to ensure correct operation. note: the cpu level in register psw is not modified by the trap instruction, so the service routine is executed on the same priority level from which it was invoked. therefore, the service routine entered by the trap instruction can be interrupted by other traps or higher priority interrupts, other than when triggered by a hardware trap. hardware traps hardware traps are issued by faults or specific system states that occur during runtime of a program (not identified at assembly time). a hardware trap may also be triggered intentionally, e.g. to emulate additional instructions by generating an illegal opcode trap or to enter the ocds software debug mode. m2 distinguishes eight different hardware trap functions. when a hardware trap condition has been detected, the cpu branches to the trap vector location for the respective trap condition. depending on the trap condition, the instruction which caused the trap is either completed or cancelled (i.e. it has no effect on the system state) before the trap handling routine is entered. hardware traps are non-maskable and always have priority over every other cpu activity. if several hardware trap conditions are detected within the same instruction cycle, the highest priority trap is serviced (see table 5-1 ). psw, csp (in segmentation mode), and ip are pushed on the internal system stack and the cpu level in the psw register is set to the highest possible priority level (i.e. level
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 30 micronas 15), disabling all interrupts. the csp is set to code segment zero, if segmentation is enabled. a trap service routine must be terminated with the reti instruction. the nine hardware trap functions of m2 are divided into two classes: class a traps are  external non-maskable interrupt (nmi)  stack overflow  stack underflow trap these traps share the same trap priority, but have an individual vector address. class b traps are  undefined opcode  protection fault  illegal word operand access  illegal instruction access  illegal external bus access trap these traps share the same trap priority and vector address. the debug trap (see chapter x ? ocds ? ) is set apart and has its own individual priority and vector address. the bit-addressable trap flag register (tfr) allows a trap service routine to identify the kind of trap which caused the exception. each trap function is indicated by a separate request flag. when a hardware trap occurs, the corresponding request flag in the tfr register is set to ? 1 ? . tfr reset value: 0000 h bit function illbus illegal external bus access flag an external access has been attempted without a defined external bus. illina illegal instruction access flag a branch to an odd address has been attempted. illopa illegal word operand access flag a word operand access (read or write) to an odd address has been attempted. prtflt protection fault flag a protected instruction with an illegal format has been detected. - 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw - - - - rw - - - stk uf ill bus ill ina ill opa prt flt und opc stk of - - - - - - - rw rw de bug rw
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 31 micronas note: the trap service routine must clear the respective trap flag, otherwise a new trap will be requested after exiting the service routine. setting a trap request flag by software causes the same effects as if it had been set by hardware. the reset functions (hardware, software, watchdog) may be regarded as a type of trap. reset functions have the highest system priority (trap priority iv). the debug trap has the second highest priority (trap priority iii) and can interrupt any class a or class b trap. if a class a or class b trap and a debug trap occur at the same time, both flags are set in the tfr but the debug trap is executed first. class a traps have the third highest priority (trap priority ii), class b traps are on the 4rd rank so a class a trap can interrupt a class b trap. if more than one class a trap occurs at a time, they are prioritized internally, with the nmi trap on the highest and the stack underflow trap on the lowest priority. all class b traps have the same trap priority (trap priority i). when several class b traps are activated at a time, the corresponding flags in the tfr register are set and the trap service routine is entered. since all class b traps have the same vector, the priority of service of simultaneously occurring class b traps is determined by software in the trap service routine. a class a trap occurring during the execution of a class b trap service routine will be serviced immediately. however, during the execution of a class a trap service routine, any class b trap which occurs will not be serviced until the class a trap service routine is exited with a reti instruction. in this case, the occurrence of the class b trap condition is stored in the tfr register, but the ip value of the instruction which caused this trap is lost. in the case where e.g. an undefined opcode trap (class b) occurs simultaneously with an nmi trap (class a), both the nmi and the undopc flag is set, the ip of the instruction with the undefined opcode is pushed onto the system stack, but the nmi trap is executed. undopc undefined opcode flag the currently decoded instruction has no valid m2 opcode. debug debug trap flag a debug event programmed to trigger a debug trap has been detected by the ocds. stkuf stack underflow flag the current stack pointer value exceeds the content of register stkun. stkof stack overflow flag the current stack pointer value falls below the content of register stkov. bit function
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 32 micronas after returning from the nmi service routine, the ip is popped from the stack and immediately pushed again because of the pending undopc trap. debug trap the ocds may be programmed to trigger a debug trap when a debug event (match of data/address comparison, execution of debug instruction, event on brk_in_n input) rises. this is normally used to call a monitor routine (software debug mode) for debugging purposes. normal program execution resumes when a regular reti instruction is executed, which ends the monitor routine. this trap has the highest priority (except for reset functions) but the monitor routine can reduce its own priority by writing the ilvl field in the psw. external nmi trap whenever a high to low transition on the designated nmi_n pin (non-maskable interrupt) is detected, the nmi flag in the tfr register is set and the cpu will enter the nmi trap routine. the ip value pushed on the system stack is the address of the instruction following the one after which normal processing was interrupted by the nmi trap. note: the nmi_n pin is sampled with every cpu clock cycle to detect transitions. stack overflow trap whenever the stack pointer is decremented to a value which is less than the value in the stack overflow register stkov, the stkof flag in the tfr register is set and the cpu will enter the stack overflow trap routine. which ip value will be pushed onto the system stack depends on which operation caused the decrement of the sp. when an implicit decrement of the sp is made through a push or call instruction, or upon interrupt or trap entry, the ip value pushed is the address of the following instruction. when the sp is decremented by a subtract instruction, the ip value pushed represents the instruction address following the post subtract-instruction command. to recover from stack overflow it must be ensured that there is enough excess space on the stack to save the current system state twice (psw, ip, in segmented mode also csp). otherwise, a system reset should be generated. stack underflow trap whenever the stack pointer is incremented to a value which is greater than the value in the stack underflow register stkun, the stkuf flag is set in the tfr register and the cpu will enter the stack underflow trap routine. again, which ip value will be pushed onto the system stack depends on which operation caused the increment of the sp. when an implicit increment of the sp is made through a pop or return instruction, the ip value pushed is the address of the following instruction. when the sp is incremented by an
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 33 micronas add instruction, the pushed ip value represents the instruction address following the post add-instruction command. undefined opcode trap when the instruction currently decoded by the cpu does not contain a valid m2 opcode, the undopc flag is set in register tfr and the cpu enters the undefined opcode trap routine. the ip value pushed onto the system stack is the address of the instruction that caused the trap. this can be used to emulate unimplemented instructions. the trap service routine can examine the faulting instruction to decode operands for unimplemented opcodes based on the stacked ip. in order to resume processing, the stacked ip value must be incremented by the size of the undefined instruction, which is determined by the user, before a reti instruction is executed. protection fault trap whenever one of the special protected instructions is executed where the opcode of that instruction is not repeated twice in the second word of the instruction, and the byte following the opcode is not the complement of the opcode, the prtflt flag in register tfr is set and the cpu enters the protection fault trap routine. the protected instructions include diswdt, einit, idle, pwrdn, srst, and srvwdt. the ip value pushed onto the system stack for the protection fault trap is the address of the instruction that caused the trap. illegal word operand access trap whenever a word operand read or write access is attempted to an odd byte address, the illopa flag in the tfr register is set and the cpu enters the illegal word operand access trap routine. the ip value pushed onto the system stack is the address of the instruction following the one which caused the trap. illegal instruction access trap whenever a branch is made to an odd byte address, the illina flag in the tfr register is set, and the cpu enters the illegal instruction access trap routine. the ip value pushed onto the system stack is the illegal odd target address of the branch instruction. illegal external bus access trap whenever the cpu requests an external instruction fetch, data read or data write, and no external bus configuration has been specified, the illbus flag in the tfr register is set, and the cpu enters the illegal bus access trap routine. the ip value pushed onto the system stack is the address of the instruction following the one which caused the trap.
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 34 micronas 5.3.1 external interrupt source control fast external interrupts may also have interrupt sources selected from other peripherals. this function is very advantageous in slow down or in sleep mode if, for example, the a/d converter input shall be used to wakeup the system. the register exisel is used to switch alternate interrupt sources to the interrupt controller. the exisel register is defined as follows:
sda 6000 preliminary data sheet version 2.1 interrupt and trap functions 5 - 35 micronas exisel reset value: 0000 h bit function exixss external interrupt x source selection field (x = 7 ? 0) 0 0: input from default pin 0 1: input from ? alternate source ? 1 0: input from default pin ored with ? alternate source ? 1 1: input from default pin anded with ? alternate source ? fast interrupt alternate source (input feixin_b) 0adwint 1 reserved 2 reserved 3 reserved 4 reserved 5 reserved 6 reserved 7 reserved 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw exi2ss exi0ss exi1ss rw rw rw exi7ss exi5ss exi6ss rw rw exi3ss exi4ss
system control & configuration
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 3 micronas 6 system control & configuration m2 has extended features for system level control and configuration. most of these features are now handled by a new block inside the m2 which is the system control unit (scu). the scu is used to control system-level tasks such as reset control, clock control and power management. it is implemented to ease compatibility of new m2 based products with already existing c16x derivatives. m2 provides the following functions for system control and configuration:  system and controller core reset function  system and controller core start-up configuration  configuration registers protection  clock management functions  power management modes (idle, sleep, power down)  watchdog timer  identification registers for core (cpu, scu, ocds) and system (manufacturer, chip version, memory) identification these functions are explained in further details in the following paragraphs.
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 4 micronas 6.1 system reset the internal system reset function provides the initialization of the m2 into a defined default state and is invoked either by asserting a hardware reset signal on pin rstin (hardware reset input), upon the execution of the srst instruction (software reset) or by an overflow of the watchdog timer. whenever one of these conditions occurs, the cbc is reset into its predefined default state through an internal reset procedure. when a reset, other than a watchdog reset, is initiated, pending internal hold states are cancelled and any external bus cycle is aborted (see description). after the reset condition is removed, m2 will start program execution from memory location 00 ? 0000 h in code segment zero. this start location will typically hold a branch instruction to the start of a software initialization routine for the configuration of peripherals and m2 sfrs. m2 recognizes the following reset conditions. reset conditions are indicated in the wdtcon register. hardware reset a hardware reset is triggered asynchronously by a falling edge of the reset input signal, rstin . to ensure the recognition of the rstin signal, it must be held low for at least 2 cpu clock cycles, assuming the clock input signal is stable. also, shorter rstin pulses may trigger a hardware reset, however, this is not recommended. the internal reset condition is prolonged until one of the following conditions arises:  the rising edge of the rstin signal, or  the termination of the reset sequence, if rstin was deasserted before, or  the termination of the lengthening conditions. after termination of the reset state, program execution will start. three different kinds of hardware reset conditions are considered:  power-on reset a complete power-on reset requires an active rstin time until a stable clock signal is available. the on-chip oscillator needs about 2 ms to stabilize. reset type short-cut condition power-on reset ponr power-on short hardware reset shwr 16 tcl < t rstin ? 2048 tcl long hardware reset lhwr t rstin > 2048 tcl watchdog timer reset wdtr wdt overflow software reset swr srst command
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 5 micronas  long hardware reset a long hardware reset requires an rstin active time longer than the duration of the internal reset sequence. the duration of the internal reset sequence is 2056 tcl. after the internal reset sequence has been completed, the rstin input is sampled. as long as the reset input is still active the internal reset condition is prolonged. accordingly, the internal hardware reset (hwrst) is active until the external reset on the rstin input becomes inactive. note: the hardware reset is also used as a wake up from power down state; in this case the internal system reset will be lengthened (execution of 1. instruction delayed) until the oscillator and pll have been stabilized.  short hardware reset the rstin active time of a short hardware reset is between 16 tcl and 2056 tcl. if the rstin signal is active for at least 16 tcl clock cycles the internal reset sequence is started (see below). in case of a short hw-reset, the internal hwrst signal is prolonged until the reset sequence is finished. software reset the reset sequence can be triggered at any time via the protected instruction srst (software reset). this instruction can be executed deliberately within a program, e.g. to leave bootstrap loader mode, or upon a hardware trap that reveals a system failure. watchdog timer reset when the watchdog timer is not disabled during the initialization or serviced regularly during program execution it will overflow and trigger the reset sequence. other than hardware and software reset the watchdog reset completes a running external bus or x- bus cycle. 6.1.1 behavior of i/os during reset during the internal reset sequence all of the m2 ? s i/o pins are configured as inputs by clearing the associated direction registers and switching their pin drivers to the high impedance state. this ensures that the m2 and external devices will not try to drive the same pin to different levels. outputs are generally driven to their expected inactive state during reset. output pins driven to ? 0 ? are: a13 ? a0; memclk, clken, xtal2, cor, blank and tdo. output pins driven to ? 1 ? are: a15 (cas ),a14 (ras ), rd , csrom , csdram , wr , p4.5(cs3 ), p4.4 ? p4.0, ldqm and udqm. 6.1.2 reset values for the controller core registers during the reset sequence the registers of the c166 cbc are preset with a default value. most c166 cbc sfrs are cleared to zero, so the interrupt system is off after reset. a
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 6 micronas few exceptions to this rule provide a first pre-initialization, which is either fixed or controlled by input pins. dpp1: 0001 h (points to data page 1) dpp2: 0002 h (points to data page 2) dpp3: 0003 h (points to data page 3) cp: fc00 h stkun: fc00 h stkov: fa00 h sp: fc00 h syscon: 0400 h (set according to start-up configuration) buscon0: 15b7 h (set according to start-up configuration) ones: ffff h (fixed value) 6.1.3 the internal ram after reset the contents of the internal ram are not affected by a reset. however, after a power-on reset, the contents of the internal ram are undefined. this implies that the gprs (r15 ? r0) and the pec source and destination pointers (srcp7 ? srcp0, dstp7 ? dstp0), which are mapped into the internal ram, are also unchanged after a warm reset, software reset or watchdog reset, but are undefined after a power-on reset.
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 7 micronas 6.2 system start-up configuration although most of the programmable features of the m2 are either selected during the initialization routine or repeatedly during program execution, there are some features that must be selected earlier, because they are used for the first access of the program execution. the system start-up configuration is determined by the level on port4 at the end of the internal reset sequence. during reset internal pull-up devices are active on port4 lines, so their input level is high, if the respective pin is left open, or is low, if the respective pin is connected to an external pull-down device. the value ffff h on port4 will select the default configuration during reset. if a particular configuration is required, the corresponding line(s) should be driven low according to the coding of the selections, as shown below. registers syscon and buscon0 are initialized according to the selected configuration. pins that control the operation of the internal control logic and reserved pins are evaluated only during a hardware triggered reset sequence. pins that influence the configuration of the m2 are evaluated during any reset sequence, e.g. also during software and watchdog timer triggered resets. the configuration input via port4 is latched in register rp0h for subsequent evaluation by software. rp0h reset value: 00xx h bootstrap loader mode pin p4.0 (bsl) activates the on-chip bootstrap loader, when low, during reset. the bootstrap loader allows the start code to move into the internal ram of the m2 via the bit function csena chip select lines selection number of external roms. description of possible selections: see table below (start up configuration) salsel (2 ? 0) segment address lines selection number of active segment address outputs. description of possible selections: see table below (start up configuration) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r 0 0 0 0 1 1 1 cs ena 1 0 salsel(2..0) 0 0 0
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 8 micronas serial interface asc0. the m2 will remain in bootstrap loader mode until a hardware reset with p4.0 high or a software reset. default: the m2 starts fetching code from location 00 ? 0000 h , the bootstrap loader is off. chip select line pin p4.1 (csena) defines the external memory configuration. when pulled low it enables chip select 3 (cs3 ) (a second rom device is assumed). rp0h.1 = ? 0 ? denotes the memory configuration with only one rom device while rp0h.1 = ? 1 ? indicates availability of the 2nd rom device. note: cs3 status cannot be changed via software after reset. segment address lines the status of pins p4.5 ? p4.3 (salsel) during reset defines the number of active segment address lines. this allows the selection which pins of port 4 drive address lines and which are used for general purpose i/o. the three bits are latched in register rp0h. depending on the system architecture the required address space is chosen and accessible right from the start, so the initialization routine can directly access all locations without prior programming. the required pins of port 4 are automatically switched to address output mode. during runtime the configured number of segment address line can be read from bit field rp0h.5 (= salsel.2) ? rp0h.3 (= salsel.0). default: 5-bit segment address (a20 ? a16) allowing access to 4 mbyte. note: the selected number of segment address lines cannot be changed via software after reset. salsel segment address lines directly accessible address space 1 1 1 a20, a19, a18, a17, a16 4 mbyte (default without pull-downs) 1 1 0 a19, a18, a17, a16 2 mbyte 1 0 1 a18, a17, a16 1 mbyte 1 0 0 a17, a16 512 kbyte 0 1 1 a16 256 kbyte 0 1 0 ? 128 kbyte 0 0 1 ? 128 kbyte 0 0 0 ? 128 kbyte
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 9 micronas 6.3 register write protection the system control unit (scu) provides two different protection types of configuration registers:  unprotected registers  protectable registers the unprotected registers allow the reading and writing (if not read-only) of register values without any restrictions. however, the write access of the protectable registers (security registers) can be programmed for three different modes of security level , whereas the read access is always unprotected:  write protected mode  low protected mode  unprotected mode in write protected mode, the registers can not be accessed by a write command. however, in low protected mode, the registers can be written with a special command sequence (see description below). if the registers are set to unprotected mode, all write accesses are possible. some register controlled functions and modes which are critical for m2 ? s operation are locked after the execution of einit, so these vital system functions cannot be changed inadvertently e.g. by software errors. however, as these security registers also control the power management, they need to be accessed during operation to select the appropriate mode. the switching between the different security levels is controlled by a state machine. by using a password and command sequence the security levels can be changed. after reset the unprotected mode is always automatically selected. the einit command switches the security level automatically to protected mode. the low protected mode is especially important for a standby state of the application. this mode allows fast accesses within 2 commands to the protected registers without removing the protection completely. security level switching two registers are provided for switching the security level, the security level command register scuslc and the security level status register scusls. the security level command register scuslc is used to control the state machine for switching the security level. the scuslc register is loaded with the different commands of the command sequence necessary to control a change in the security level. it is also used for the one unlock command, which is necessary in the low protected mode to access one protected register. the commands of the (unlock) command sequence are characterized by certain pattern words (such as aaaa h ) or by patterns combined with an 8-bit password. for command definition see the following state diagram ( figure 6-1 ).
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 10 micronas the new password is defined with command 3 and stored in the according 8-bit field in the scusls register. the scuslc register is defined as follows scuslc reset value: 0000 h the security level status register scusls is a read only register which shows the current password, the actual security level and the state of the switching state machine. the scusls is defined as follows: bit function command code of command to be executed command 0 : ? aaaa h ? command 1 : ? 5554 h ? command 2 : ? 96 & inverse password ? command 3 : ? 000 b ? & new level & ? 000 b ? & new password command 4 : ? 8e h ? & inverse password (command 4 unlocks protected registers for one write access if current security level is in low protected mode.) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw command
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 11 micronas scusls reset value: 0000 h the following registers are defined as protected (security) registers:  syscon1  syscon2  syscon3 bit function password current password sl current security level ? 00 ? : unprotected write mode ? 01 ? : low protected mode ? 10 ? : reserved ? 11 ? : write protected mode state current state ? 000 ? : state 0 = wait for command 0. ? 001 ? : state 1 = wait for command 1. ? 010 ? : state 2 = wait for command 2. ? 011 ? : state 3 = wait for new security level and new password (command 3). ? 100 ? : state 4 = protected registers are unlocked. write access to one register is possible (only in low protected mode). ? 101 ? : reserved ? 110 ? : reserved ? 111 ? : reserved 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r state sl - - - password r r
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 12 micronas the following state diagram shows the state machine for security level switching and for unlock command execution in low protected mode: figure 6-1 state machine for security level switching note: 1) the new security level and password are valid, only if the security level command register is accessed. c_scu is an abbreviation for ? write access to any scu register ? , i.e. write access to any of the following registers: syscon1, syscon2, scuslc, scusls, rp0h, xpercon, wdt, wdtcon, exicon, exisel, isnc, focon, syscon3 note: the focon and syscon3 registers do not provide any function within the m2. nevertheless they are implemented in the system control unit of the embedded microcontroller and write access to the associated addresses will influence the state machine for security level switching. write access in low protected mode the write access in low protected mode is also done via a command sequence. first the specific command 4 (see figure 6-1 ) has to be written to register scuslc with the current password. after this command, all security registers are unlocked until the next write access to any scu register is done. read access is always possible to all registers of the scu and will not influence the command sequences. in register scuscs the actual status of the command state machine can always be read. it is recommended to use an atomic sequence for all command sequences. ued11131 state 0 state 1 state 4 command 0 command 1 or any other scu register write access state 2 state 3 command 2 register write access or any other scu command 2 register write access or any other scu command 3 1) command 1 and low protected mode command 4 any scu register write access reset
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 13 micronas 6.4 power reduction modes three power reduction modes with different levels of power reduction, which may be entered under software control, have been implemented in m2: idle mode: the cpu is stopped, while the peripherals including watchdog timer continue their operation at low clock frequency. sleep mode: cpu, peripherals and pll are completely turned off. the controller adc operates in wake-up mode. the real-time-clock is still in operation. power down mode: all modules are turned off. in the table above clocking frequencies have been specified, indicating that power reduction is achieved by means of clock-gating. none of the power supplies are internally switched, neither may voltage be turned off at the supply pins. m2 ? s power management functions are supplemented by a real time clock (rtc) timer with optional periodic wake-up from idle mode. the periodic wake-up combines the reduced power consumption in power reduction modes with a high level of system availability. external signals and events can be scanned (at a lower rate) by periodically activating the cpu and selected peripherals which then return to power-save mode after a short time. this greatly reduces the system ? s average power consumption. entering and terminating idle and sleep mode all three modes are entered by writing register sleepcon (see register definition below) and issuing the idle instruction. all external bus actions are completed before entry to idle, sleep or power down mode. normal operation is resumed after idle mode upon any interrupt request. to return from sleep mode, external, wake up- or rtc- mode normal idle sleep power down oscillator on on on off pll on on off off cpu 33 mhz 3 mhz/ stopped no clock/ stopped no clock/ stopped cadc 33 mhz 1) 1) conversion mode 3 mhz 2) 2) wake up mode 3 mhz 2) off rtc 3 mhz 3 mhz 3 mhz off peripherals 33 mhz 3 mhz off off bus interface 100/66 mhz 3) 3) depending on value of clkcon (see chapter 8 ) off off off
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 14 micronas interrupt requests can be used. power down mode can only be terminated with hardware reset. to prevent unintentional entry into idle mode, the idle instruction has been implemented as a protected 32-bit instruction. idle mode is terminated by interrupt requests from any enabled interrupt source whose individual interrupt enable flag was set before the idle mode was entered, regardless of bit ien. for a request selected for cpu interrupt service, the associated interrupt service routine is entered if the priority level of the requesting source is higher than the current cpu priority and the interrupt system is globally enabled. after the reti (return from interrupt) instruction of the interrupt service routine is executed the cpu continues executing the program with the instruction following the idle instruction. otherwise, if the interrupt request cannot be serviced because of a too low priority or a globally disabled interrupt system the cpu immediately resumes normal program execution with the instruction following the idle instruction. for a request which was programmed for pec service, a pec data transfer is performed if the priority level of this request is higher than the current cpu priority and the interrupt system is globally enabled. after the pec data transfer has been completed the cpu remains in idle mode. otherwise, if the pec request cannot be serviced because of a too low priority or a globally disabled interrupt system, the cpu does not remain in idle mode but continues program execution with the instruction following the idle instruction. mode idle sleep power down entry by ? writing sleepcon and issuing idle instruction exit by ? any interrupt request external, wake up- or rtc- irq hw-reset
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 15 micronas figure 6-2 transitions between idle mode and active mode any interrupt request, whose individual interrupt enable flag was set before idle mode was entered, will terminate idle mode regardless of the current cpu priority. the cpu will not go back into idle mode when a cpu interrupt request is detected, even when the interrupt was not serviced because of a higher cpu priority or a globally disabled interrupt system (ien = ? 0 ? ). the cpu will only go back into idle mode when the interrupt system is globally enabled (ien = ? 1 ? ) and a pec service on a priority level higher than the current cpu level is requested and executed. note: an interrupt request which is individually enabled and assigned to priority level 0 will terminate idle mode. however, the associated interrupt vector will not be accessed. the watchdog timer may be used to monitor the idle mode: an internal reset will be generated if no interrupt request occurs before the watchdog timer overflows. to prevent the watchdog timer from overflowing during idle mode it must be programmed to a reasonable time interval before idle mode is entered. power down mode clocking of all internal blocks is stopped in power down mode, the contents of the internal rams, however, are preserved through the voltage supplied via the v dd pins. the watchdog timer is stopped in power down mode. this mode can only be terminated by an external hardware reset, e.g. by asserting a low level on the rstin pin. this reset will initialize all sfrs and ports to their default state, but will not change the contents of the internal rams. sdram refreshing before entering into one of the power save modes the external sdram must be put into self-refresh-mode by use of register ebidir (see chapter 4.5 ). ued11132 active idle instruction mode idle mode accepted cpu interrupt request denied denied pec request executed pec request
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 16 micronas status of output pins during idle and power down mode during idle mode the cpu is stopped, while all peripherals continue their operation in the same way previously described. therefore all ports pins, which are configured as general purpose output pins, output the last data value which was written to their port output latches. if the alternate output function of a port pin is used by a peripheral, the state of the pin is determined by the operation of the peripheral. port 4 outputs the segment address for the last access on the pins that were selected during reset, otherwise the output pins of port 4 represent the port latch data. during power down mode the oscillator and the clocks to the cpu and peripherals are turned off. like in idle mode, all port pins, which are configured as general purpose output pins, output the last data value which was written to their port output latches. when the alternate output function of a port pin is used by a peripheral the state of this pin is determined by the last action of the peripheral before the clocks were switched off. syscon1 reset value: 0001 h note: this register is a protected register; it ? s security level is automatically set to full write protection after execution of the einit instruction. bit function sleepcon power save mode selection 00: idle mode 01: sleep mode 10: reserved 11: power down mode 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw - - - - - sleepcon - - - - - - - - -
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 17 micronas 6.5 dedicated pins m2 has different dedicated pins than other controllers of c16x family. the following dedicated pins are not available: ale , ready , ea , nmi . the following table explains m2 specific dedicated pins. the external read strobe rd controls the output drivers of external memory or peripherals when m2 reads data from these external devices. during reset an internal pull-up ensures an inactive (high) level on the rd output. the external write strobe wr controls the data transfer from the m2 to an external memory. during reset an internal pull-up ensures an inactive (high) level on the wr output. byte mask signals ldqm and udqm control the byte access to an external sdram according to the pc100 specification. these pins are active if either the high byte or the low byte of a 16-bit word are written. the oscillator input xtal1 and output xtal2 connect the internal oscillator to the external crystal. the oscillator provides an inverter and a feedback element. an external ttl clock signal may be fed to the input xtal1, leaving xtal2 open. by using the rstin pin m2 can be put into the well defined reset condition either at power-up or upon external events like a hardware failure or manual reset. the internal reset signal can be driven on output pin rstout /cor . the chipselect signals csdram , csrom , cs3 are for general control of external memories. during reset an internal pull-up ensures an inactive (high) level on these outputs. cs3 can be used for a rom. pin(s) function rd external read strobe wr write enable strobe for sdram ldqm, udqm byte mask signals for sdram xtal1, xtal2 oscillator input/output rstin reset input pin csdram , csrom , cs3 chip select signals memclk, clken clock signals for sdram cvbs1, cvbs2 cvbs input signals r, g, b analog rgb output corbla contrast reduction and blanking pin hsync, vsync sync inputs/outputs for the display
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 18 micronas signals memclk, clken are used to provide a clock and an enable signal for an external sdram. during reset an internal pull-down ensures an inactive (low) level on these outputs. cvbs1a, cvbs1b and cvbs2 can carry two analog composite video signals and act as inputs for the two data slicers. the video signal on channel 1 can be either differential (cvbs1a and cvbs1b) or single-ended (cvbs1a, cvbs1b to ground). r, g, b are analog outputs from the display generator. corbla is a signal which indicates whether a pixel created by m2 should be displayed or mixed with external video source (blanking function). at the same time this signal carries information on contrast reduction of this pixel. alternatively blank can be generated as a separate output signal. cor can be generated separately as well, in which case no rstout is available. hsync and vsync are bidirectional pins which are used to synchronize m2 to an external video source or to deliver a stable horizontal and vertical sync timing to external components.
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 19 micronas 6.6 xbus configuration although the xbus is not visible at the chip boundary, some registers have to be set to guarantee correct operation. the user has to program the xbus-registers in the following way: register value syscon e444 h xadrs1 0e03 h xadrs2 0e83 h xadrs3 - xadrs6 (not used) 0000 h addrsel1 - addrsel4 (not used) 0000 h xbcon1 05bf h xbcon2 05bf h xbcon3 - xbcon6 (not used) 0000 h buscon0 15b7 h buscon1 - buscon4 (not used) 0000 h xpercon 0003 h
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 20 micronas 6.7 watchdog timer the watchdog timer is a 16-bit up counter which can be clocked with the cpu clock ( f cpu ), either divided by 2 or divided by 128. this 16-bit timer is realized as two concatenated 8-bit timers (see figure 6-3 ). the upper 8 bits of the watchdog timer can be preset to a user-programmable value via a watchdog service access in order to vary the watchdog expire time. the lower 8 bits are reset on each service access. the following figure shows the wdt block diagram: figure 6-3 wdt block diagram the current count value of the watchdog timer is contained in the watchdog timer register wdt, which is a non-bitaddressable read-only register. the operation of the watchdog timer is controlled by its bitaddressable watchdog timer control register wdtcon. this register specifies the reload value for the high byte of the timer and selects the input clock prescaling factor. after any software reset, external hardware reset (see note), or watchdog timer reset, the watchdog timer is enabled and starts counting up from 0000 h with the frequency f cpu /2. the input frequency may be switched to f cpu /128 by setting bit wdtin. the watchdog timer can be disabled via the instruction diswdt (disable watchdog timer). instruction diswdt is a protected 32-bit instruction which will only be executed during the time between a reset and execution of either the einit (end of initialization) or the srvwdt (service watchdog timer) instruction. either one of these instructions disables the execution of diswdt. when the watchdog timer is not disabled via instruction diswdt it will continue counting up, even during idle mode. if it is not serviced by the srvwdt instruction by the time the count reaches ffff h the watchdog timer will overflow and cause an internal reset. in this case the watchdog timer reset indication flag (wdtr) in register wdtcon will be set. ueb11133 wdt control wdt low byte wdt f mux wdtin diswdt clear wdt high byte wdtrel wdtr 2 128
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 21 micronas to prevent the watchdog timer from overflowing, it must be serviced periodically by the user software. the watchdog timer is serviced with the instruction srvwdt, which is a protected 32-bit instruction. servicing the watchdog timer clears the low byte and reloads the high byte of the watchdog time wdt register with the preset value in bit field wdtrel, which is the high byte of the wdtcon register. servicing the watchdog timer will also reset the wdtr bit. after being serviced the watchdog timer continues counting up from the value ( ? 28). instruction srvwdt has been encoded in such a way that the chance of unintentionally servicing the watchdog timer (e.g. by fetching and executing a bit pattern from a wrong location) is minimized. when instruction srvwdt does not match the format for protected instructions, the protection fault trap will be entered, rather than the instruction being executed. the time period for an overflow of the watchdog timer is programmable in two ways:  the input frequency of the watchdog timer can be selected via bit wdtin in register wdtcon to be either f cpu /2 or f cpu /128.  the reload value wdtrel for the high byte of wdt can be programmed in register wdtcon. the period p wdt between servicing the watchdog timer and the next overflow can therefore be determined by the following formula: p wdt =(2 (1 + ? 6) ? (2 16 ? ? 2 8 ))/ f cpu [1] table 6-1 marks the possible ranges for the watchdog time which can be achieved using a certain cpu clock. some numbers are rounded to 3 significant digits. note: for safety reasons, the user is advised to rewrite wdtcon each time before the watchdog timer is serviced. here is the description of the watchdog timer sfrs. table 6-1 watchdog time ranges reload value in wdtrel prescaler for f cpu 2 (wdtin = ? 0 ? ) 128 (wdtin = ? 1 ? ) 33.33 mhz 3 mhz 33.33 mhz 3 mhz ff h 25.6 s 32.0 s 1.64 ms 2.05 ms 7f h 3.3 ms 4.13 ms 211 ms 264 ms 00 h 6.55 ms 8.19 ms 419 ms 524 ms
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 22 micronas wdtcon reset value: 00xx h note: the reset value depends on the reset source (see description below). the execution of einit clears the reset indication flags. note: when the reset output is enabled pin rstout will be pulled low for the duration of the internal reset sequence upon a watchdog timer reset. wdt timer register the wdt register contains the current count value of the watchdog timer. wdt reset value: 0000 h note: this register in a read-only register. write access can be performed to this register, during test mode only. bit function wdtin watchdog timer input frequency selection 0: input frequency is f cpu /2 1: input frequency is f cpu /128 wdtr watchdog timer reset indication flag cleared by a hardware reset or by the srvwdt instruction. swr software reset indication flag shwr short hardware reset indication flag lhwr long hardware reset indication flag wdtrel (7 ? 0) watchdog timer reload value (for the high byte of wdt) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw r r r r rw wdtrel(7 .. 0) - - - lhw r shw r sw r wdt r wdt in 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r wdt(15 .. 0)
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 23 micronas reset source indication the reset indication flags in register wdtcon provide information on the source of the last reset. as m2 starts executing from location 00 ? 0000 h after any possible reset event, the initialization software may check these flags in order to determine if the recent reset event was triggered by an external hardware signal (via rstin ), by software itself or by an overflow of the watchdog timer. the initialization (and also the further operation) of the microcontroller system can thus be adapted to the respective circumstances, e.g. a special routine may verify the software integrity after a watchdog timer reset. the reset indication flags are not mutually exclusive, e.g. more than one flag may be set after reset depending on its source. the table below summarizes the possible combinations: note: *) when the reset output is enabled, the indicated flags are also set in the respective reset case. the wdtcon reset value will then be different from the table value. note: the listed reset values for wdtcon assume the reserved bits as ? 0 ? . long hardware reset is indicated when the rstin input is still sampled low (active) at the end of a hardware triggered internal reset sequence. short hardware reset is indicated when the rstin input is sampled high (inactive) at the end of a hardware triggered internal reset sequence. software reset is indicated after a reset triggered by the execution of instruction srst. watchdog timer reset is indicated after a reset triggered by an overflow of the watchdog timer. note: when reset output is enabled the rstout pin is pulled low for the duration of the internal reset sequence upon any sort of reset. therefore a long hardware reset (lhwr) will be recognized in any case. table 6-2 reset indication flag combinations reset indication flags reset source lhwr shwr swr wdtr long hardware reset x x x ? short hardware reset * x x ? software reset * * x ? watchdog timer reset * * x x
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 24 micronas 6.8 bootstrap loader the bootstrap loader of m2 works in the same way as implemented in other c16x derivatives. it provides a mechanism to load the start-up program, which is executed after reset, via a serial interface (asc). in this case no external (rom) memory is required. the bootstrap loader moves code/data into the internal ram, but it is also possible to transfer data via the serial interface into an external ram using a second level loader routine. figure 6-4 bootstrap loader sequence the m2 enters bsl mode, if pin p4.0 is sampled low at the end of a hardware reset. when m2 has entered bsl mode, the following configuration is automatically set (values that deviate from the normal reset values, are marked ): watchdog timer: disabled register syscon: 0c00 h context pointer cp: fa00 h register stkun: fa40 h stack pointer sp: fa40 h register stkov: fa0c h 0 <-> c register s0con: 8001 h uet11134 rstin p4.0 rxd0 txd0 csp:ip 1) 2) 4) 3) int. boot rom bsl-routine 32 bytes user software bsl initialization time, > 1.5 1) s @ cpu f = 33 mhz zero byte (1 start bit, eight ? 0 ? data bits, 1 stop bit), sent by host 2) 3) identification byte (d5 h ) sent by m2 4) 32 bytes of code/data, sent by host
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 25 micronas register buscon0: according to start-up config. register s0bg: according to ? 00 ? byte p3.10/txd0: ? 1 ? dp3.10: ? 1 ? other than after a normal reset the watchdog timer is disabled, therefore the bootstrap loading sequence is not time limited. pin txd0 is configured as output. the configuration (e.g. the accessibility) of the m2 ? s memory areas after reset in bootstrap-loader mode differs from the standard case. accesses to the external rom area are partly redirected, while the m2 is in bsl mode. all code fetches to segment 0 are made from the special boot-rom, while data accesses read from the external user rom.
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 26 micronas 6.9 identification registers a set of 8 identification registers are provided to offer information on the chip as manufacturer, chip type and its memory (eeprom, otp, dram or flash memory) properties, and information on the cscu (type of module, redesign state). the id registers are read only registers. these registers are:  idmanuf, for manufacturer and department identification,  idchip, for device identification and revision code,  idmem, for identification of on-chip program memory (type, size),  idmem2, for identification of additional eeprom, otp, dram or flash memory,  idprog, for identification of programming/erasing voltage of on-chip program memory,  idrt, redesign tracking register for identification of revisions and laser cuts. besides, some other registers provide identification of some parts of the m2. these registers are hardwired inside the m2.  cpuid, for cpu identification,  idscu, for cscu identification,  dipx version bit field, for ocds identification. 6.9.1 system identification these identific id register description idmanuf reset value: xxxx h 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r r manuf dept
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 27 micronas idchip reset value: xxxx h idmem reset value: xxxx h idmem2 reset value: xxxx h note: idmem2 describes the second block of (program) memory. e.g. a device may contain flash and eeprom or dram sections. static ram modules are not described with id registers. bit function manuf manufacturer this is the jedec normalized manufacturer code. 0c1 h :infineon technologies 020 h : sgs-thomson dept department i nd i ca t es t he de p a r tm e nt w i t h i n mi cr on as a n d i n f i neon t ech n o l og i es. 00 h :hl mc 01 h : hl cad macrocells 02 h :hl it bit function revision device revision code identifies the device step where the first release is marked ? 01 h ? . chipid device identification identifies the device name. please refer to the association table. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r r chipid chip revision number 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r r type size 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r r type size
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 28 micronas idprog reset value: xxxx h note: 1) devices that incorporate memories which cannot be programmed outside the factory will indicate ? 00 h ? in both bit fields. idrt reset value: xxxx h note: the redesign tracing register idrt is not commonly specified. it is protected against standard read accesses via the function testmode (testmode a). bit function size size of on-chip program memory the size of the implemented program memory in terms of 4 k blocks, i.e. memory-size = ? 4kbyte. type type of on-chip program memory identifies the memory type on this silicon. 0 h :romless 1 h : mask rom 2 h :eprom 3 h :flash 4 h :otp 5 h :eeprom 6 h : dram/sram bit function progvdd programming v dd voltage 1) the voltage of the standard power supply pins required when programming or erasing (if applicable) the on-chip program memory. formula: v dd =20 ? /256 [v] progvpp programming v pp voltage 1) the voltage of the special programming power supply (if existent) required to program or erase (if applicable) the on-chip program memory. formula: v pp =20 ? /256 [v] 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r r progvpp progvdd - ra - - - - - - - - - - - lc 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r r rix r - - - - - - - - - -
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 29 micronas 6.9.2 cpu identification the cpu is identified by the cpuid register. this register is only implemented on starlib versions of the m2 rev. 2.0. cpuid reset value: 0061 h the scu provides a specific read-only identification register for its own module type and revision identification. idscu reset value: 0000 h for rev. 2.0 derivatives, the current value is 0000 h . bit function rix redesign index 0: this device is the original ? revision ? . else: this device has experienced minor changes that are not reflected to the customer by the ? revision ? bit field. ra redundancy activation 0: this device is as it was manufactured. 1: redundant memory structures have been activated. lc laser correction 0: this device is as it was manufactured. 1: this device has been laser corrected. bit function cbc rev. cbc revision number currently 011 b core id core identification number for the c166 cbc the value is 00001 b - - - - - - - - - 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r core id - - - - - - - - - - cbc rev. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r scu module number r scu revision number
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 30 micronas 6.10 parallel ports m2 provides up to 30 input/outputs, 6 output and 6 input multiple purpose ports. all port lines are bit-addressable, and all input/output lines are individually (bit-wise) programmable as inputs or outputs via direction registers. the i/o ports are true bidirectional ports which are switched to high impedance state when configured as inputs. the output drivers of two i/o ports can be configured (pin by pin) for push/pull operation or open-drain operation via control registers. during the internal reset, all port pins are configured as inputs. most of the port lines have programmable alternate input or output functions associated with them (gpt1/gpt2, external interrupts, i 2 c-bus, analog inputs for a/d converter, ssc-interface or asc-interface). all port lines that are not used for these alternate functions may be used as general purpose i/o lines. ports of m2 are 3.3 v tolerant and can deliver a 3.3 v output voltage (refer also to chapter 14 ). figure 6-5 portlogic register overview port 0 port 0 does not exist due to the dedicated memory bus structure of m2. port 1 port 1 does not exist due to the dedicated memory bus structure of m2. port 2 port 2 is an 8-bit bidirectional i/o port which can also serve as fast external interrupt input (sample rate is 30 ns). uea11135 registers p2 p3 p4 p5 p6 data input/ output open drain control registers direction control registers dp6 dp2 dp3 odp6 odp3 altselop6 p5ben registers special control
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 31 micronas p2 reset value: 0000 h dp2 reset value: 0000 h bit function p2.y port data register p2 bit y. bit function dp2.y port direction register dp2 bit y dp2.y = 0: port line p2.y is an input (high-impedance). dp2.y = 1: port line p2.y is an output. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw rw rw p2.15 p2.14 p2.13 p2.12 p2.11 p2.10 p2.9 p2.8 - - - - - - - - 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw rw rw dp2. 15 dp2. 14 dp2. 13 dp2. 12 dp2. 11 dp2. 10 dp2. 9 dp2. 8 - - - - - - - -
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 32 micronas port 3 if this 15-bit port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction register dp3. all port lines can be switched into push/pull or open drain mode via the open drain control register odp3. due to pin limitations register bit p3.14 is not connected to any pin. p3 reset value: 0000 h note: register bit p3.14 is not connected to an i/o pin. dp3 reset value: 0000 h odp3 reset value: 0000 h bit function p3.y port data register p3 bit y. bit function dp3.y port direction register dp3 bit y dp3.y = 0: port line p3.y is an input (high-impedance). dp3.y = 1: port line p3.y is an output. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw p3.15 - p3.13 p3.12 p3.11 p3.10 p3.9 p3.8 p3.7 p3.6 p3.5 p3.4 p3.3 p3.2 p3.1 p3.0 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw - rw rw rw rw rw rw rw rw rw rw rw rw rw rw dp3. 15 - dp3. 13 dp3. 12 dp3. 11 dp3. 10 dp3. 9 dp3. 8 dp3. 7 dp3. 6 dp3. 5 dp3. 4 dp3. 3 dp3. 2 dp3. 1 dp3. 0 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw odp3. 15 - odp3. 13 odp3. 12 odp3. 11 odp3. 10 odp3. 9 odp3. 8 odp3. 7 odp3. 6 odp3. 5 odp3. 4 odp3. 3 odp3. 2 odp3. 1 odp3. 0 -
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 33 micronas alternate functions of port 3 the pins of port 3 serve various functions which include external timer control lines and the 3 serial interfaces. the table below summarizes the alternate functions of port 3. port 4 port 4 is a 6-bit output port. because of its high frequency requirements in the alternate function mode, it has different electrical characteristics than the other ports. during reset, the user specific portion of the system start-up configuration is input via port 4. the complete configuration (user specific as well as hardwired settings) can be read at runtime from register rp0h. for a detailed description refer to chapter 6.1 . bit function odp3.y port 3 open drain control register bit y odp3.y = 0: port line p3.y output driver in push/pull mode. odp3.y = 1: port line p3.y output driver in open drain mode. port 3 pin alternate function p3.0 p3.1 p3.2 p3.3 p3.4 p3.5 p3.6 p3.7 p3.8 p3.9 p3.10 p3.11 p3.12 p3.13 p3.14 p3.15 scl0 i 2 c - bus clock line 0 sda0 i 2 c - bus data line 0 capin gpt2 capture input t3out timer 3 toggle output t3eud timer 3 external up/down input t4in timer 4 count input t3in timer 3 count input t2in timer 2 count input mrst ssc master receive/slave transmit mtsr ssc master transmit/slave receive txd0 asc0 transmit data output rxd0 asc0 receive data input --- no alternate function sclk ssc shift clock input/output --- not implemented. no pin assigned! led2 no alternate function
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 34 micronas p4l (during reset) reset value: xxxx h p4 reset value: 0000 h alternate functions of port 4 during external bus cycles that use segmentation (e.g. an address space above 128 kbyte), a number of port 4 pins may output the segment address lines and activate the third chip select signal (a(20 ? 16) and cs3 ). the number of pins that is used for segment address output determines the external address space which is directly accessible. the other pins of port 4 (if any) may be used for general purpose output. if segment address lines are selected, the alternate function of port 4 may be necessary to access e.g. external memory directly after reset. for this reason port 4 will be automatically switched to this alternate function. bit function p4l.0 bslena (boot strap load enable) p4l.0 = 1: boot strap loader enabled p4l.0 = 0: boot strap loader disabled p4l.1 csena (chip select enable) p4l.1 = 1: p4.5 configured as general purpose pin p4l.1 = 0: p4.5 configured as cs3 p4l.2 reserved p4l.(5 ? 3) salsel(2 ? 0) (select number of address lines) see explanation below bit function p4.y port data register p4 bit.y 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 - - - - - - - - - - p4l.5 p4l.4 p4l.3 p4l.2 p4l.1 p4l.0 r r r r r r 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw - - - - - - - - - - p4.5 p4.4 p4.3 p4.2 p4.1 p4.0
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 35 micronas the number of segment address lines is selected via p4 during reset. the selected value can be read from bit field salsel and csena of register rp0h e.g. in order to check the configuration during run time. port 5 port 5 is a 6-bit input port. p5 reset value: 0000 h alternate functions of port 5 port 5.3 ? p5.0 is also connected to the input multiplexer of the a/d converter. these lines can accept analog signals (an3 ? an0) that can be converted by the adc. port 5.15 and 5.14 also serve as external timer control lines for gpt1 and gpt2. port 4 pin altern. function salsel = 111 altern. function salsel = 110 altern. function salsel = 101 altern. function salsel = 100 altern. function salsel = 011 salsel = 010 or 001 or 000 p4.0 a16 a16 a16 a16 a16 gen. purp. i/o p4.1 a17 a17 a17 a17 gen. purp. i/o gen. purp. i/o p4.2 a18 a18 a18 gen. purp. i/o gen. purp. i/o gen. purp. i/o p4.3 a19 a19 gen. purp. i/o gen. purp. i/o gen. purp. i/o gen. purp. i/o p4.4 a20 gen. purp. i/o gen. purp. i/o gen. purp. i/o gen. purp. i/o gen. purp. i/o port 4 pin altern. function csena = 0 altern. function csena = 1 p4.5 cs3 gen. purp. i/o bit function p5.y port data register p5 bit y (read only). 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r r r r r r p5.15 p5.14 - - - - - - - - - - p5.3 p5.2 p5.1 p5.0
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 36 micronas p5ben reset value: 0000 h port 6 if this 7-bit port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction register dp6. the port lines can be switched into push/pull or open drain mode via the open drain control register odp6. p6 reset value: 0000 h port 5 pin alternate function p5.0 p5.1 p5.2 p5.3 p5.14 p5.15 ana0analog input 0 (wake up function) ana1analog input 1 ana2analog input 2 ana3 analog input 3 t4eudtimer 4 external up/down input t2eudtimer 2 external up/down input bit function p5ben.y input functionality control bit p5ben.y = 0: analog input functionality. p5ben.y = 1: digital input functionality. bit function p6.y port data register p6 bit y. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 - - - - - - - - - - - - p5b en.3 p5b en.2 p5b en.1 p5b en.0 rw rw rw rw 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw rw - - - - - - - - - p6.6 p6.5 p6.4 p6.3 p6.2 p6.1 p6.0
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 37 micronas dp6 reset value: 0000 h odp6 reset value: 0000 h alternate functions of port 6 the table below summarizes the alternate functions of port 6. bit function dp6.y port direction register dp6 bit y. dp6.y = 0: port line p6.y is an input (high-impedance). dp6.y = 1: port line p6.y is an output. bit function odp6.y port 6 open drain control register bit y odp6.y = 0: port line p6.y output driver in push/pull mode odp6.y = 1: port line p6.y output driver in open drain mode port 6 pin alternate function p6.0 p6.1 p6.2 p6.3 p6.4 p6.5 p6.6 trig_in trigger input for emulation trig_out trigger output for emulation no alternate function scl1 i 2 c bus clock line 1 sda1 i 2 c bus data line 1 no alternate function sda2 i 2 c bus data line 2 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw rw - - - - - - - - - dp6.6 dp6.5 dp6.4 dp6.3 dp6.2 dp6.1 dp6.0 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw rw - - - - - - - - - odp6. 6 odp6. 5 odp6. 4 odp6. 3 odp6. 2 odp6. 1 odp6. 0
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 38 micronas altsel0p6 reset value: 0000 h bit function selp6.y alternate function control bit selp6.y = 0: general purpose port functionality enabled for line p6.y. selp6.y = 1: alternate function enabled for line p6.y. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw rw - - - - - - - - - sel p6.6 sel p6.5 sel p6.4 sel p6.3 sel p6.2 sel p6.1 sel p6.0
sda 6000 preliminary data sheet version 2.1 system control & configuration 6 - 40 micronas
peripherals
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 3 micronas 7 peripherals all of the peripherals described in the following paragraphs are clocked with the same clock as the cpu ( f hw_clk ). depending on the mode (normal or idle), this frequency is 33.33 mhz or 3 mhz.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 4 micronas 7.1 general purpose timer unit the general purpose timer unit (gpt) represents very flexible multifunctional timer structures which may be used for timing, event counting, pulse width measurement, pulse generation, frequency multiplication, and other purposes. they incorporate five 16-bit timers that are grouped into the two timer blocks gpt1 and gpt2. each timer in each block may operate independently in a number of different modes such as gated timer or counter mode, or may be concatenated with another timer of the same block. block 1 contains 3 timers/counters with a maximum resolution of f hw_clk /4. the auxiliary timers of gpt1 may be optionally configured as reload or capture registers for the core timer. block 2 contains 2 timers/counters with a maximum resolution of f hw_clk /2. an additional caprel register supports capture and reload operations with extended functionality, and its core timer t6 may be concatenated with the timers from the capcom unit (t0 and t1). the following enumeration summarizes all features to be supported: timer block 1:  f hw_clk /4 maximum resolution  3 independent timers/counters  timers/counters can be concatenated  4 operating modes (timer, gated timer, counter, incremental)  separate interrupt nodes timer block 2:  f hw_clk /2 maximum resolution  2 independent timers/counters  timers/counters can be concatenated  3 operating modes (timer, gated timer, counter)  extended capture/reload functions via 16-bit capture/reload register caprel  separate interrupt nodes 7.1.1 functional description of timer block 1 all three timers of block 1 (t2, t3, t4) can run in 4 basic modes, which are timer, gated timer, counter and incremental interface mode. all timers can either count up or down. each timer has an input line (txin) associated with it which serves as the gate control in gated timer mode, or as the count input in counter mode. the count direction (up / down) may be programmed via software or dynamically altered by a signal at an external control input line (txeud). an overflow/underflow of core timer t3 is indicated by the output toggle latch t3otl whose state may be output on related line t3out. the auxiliary timers t2 and t4 may additionally be concatenated with the core timer, or used
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 5 micronas as capture or reload registers for the core timer. concatenation of t3 with other timers is provided through line t3otl. the current contents of each timer can be read or modified by the cpu by accessing the corresponding timer registers t2, t3, or t4, which are located in the non-bitaddressable sfr space. when any of the timer registers are written to by the cpu in the state immediately before a timer increment, decrement, reload, or capture is to be performed, the cpu write operation has priority in order to guarantee correct results. figure 7-1 structure of timer block 1 core timer t3 the operation of the core timer t3 is controlled by its bit-addressable control register t3con. run control the timer can be started or stopped by software through bit t3r (timer t3 run bit). setting bit t3r will start the timer, clearing t3r stops the timer. ueb11195 2 n : 1 2 n : 1 2 n : 1 hw_clk f t2eud t2in hw_clk f t3in t3eud t4in hw_clk f t4eud t3otl t3otl control mode t2 t3 control mode t4 control mode gpt1 timer t2 u/d reload capture gpt1 timer t3 u/d capture reload u/d gpt1 timer t4 interrupt request interrupt request interrupt request
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 6 micronas in gated timer mode, the timer will only run if t3r is set and the gate is active (high or low, as programmed). note: when bit t2rc/t4rc in timer control register t2con/t4con is set, t3r will also control (start and stop) auxiliary timer t2/t4. count direction control the count direction of the core timer can either be controlled by software or by the external input line t3eud (timer t3 external up/down control input). these options are selected by bits t3ud and t3ude in control register t3con. when the up/down control is executed by software (bit t3ude = ? 0 ? ), the count direction can be altered by setting or clearing bit t3ud. when t3ude = ? 1 ? , line t3eud is selected to be the controlling source of the count direction. however, bit t3ud can still be used to reverse the actual count direction, as shown in the table below. if t3ud = ? 0 ? and line t3eud shows a low level, the timer is counting up. with a high level t3eud, the timer is counting down. if t3ud = ? 1 ? , a high level at line t3eud specifies counting up, and a low level specifies counting down. the count direction can be changed regardless of whether the timer is running or not. when line t3eud is used as external count direction control input, its associated port pin must be configured as input. note: the direction control works in the same way for core timer t3 and for auxiliary timers t2 and t4. therefore the lines and bits are named tx ? timer 3 overflow/underflow monitoring an overflow or underflow of timer t3 will clock the overflow toggle latch t3otl in control register t3con. t3otl can also be set or reset by software. bit t3oe (overflow/ underflow output enable) in register t3con enables the state of t3otl to be monitored via an external line t3out. if this line is linked to an external port pin, which has to be configured as output, t3otl can be used to control external hw. table 7-1 core timer t3 count direction control line t3eud bit t3ude bit t3ud count direction x 00count up x 01count down 0 10count up 1 10count down 0 11count down 1 11count up
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 7 micronas in addition, t3otl can be used in conjunction with the timer over/underflows as an input for the counter function or as a trigger source for the reload function of the auxiliary timers t2 and t4. for this purpose, the state of t3otl does not have to be available at any port pin, because an internal connection is provided for this option. timer 3 in timer mode timer mode for the core timer t3 is selected by setting bit field t3m in register t3con to ? 000 b ? . in this mode, t3 is clocked with the system clock f hw_clk divided by a programmable prescaler, which is controlled by bit field t3i and bps1. the input frequency f t3 for timer t3 and its resolution r t3 are scaled linearly with lower module clock frequencies, as can be seen from the following formula: table 7-2 gives an overview for timer resolutions depending on prescaler factors. this formula also applies to the gated timer mode of t3 and to the auxiliary timers t2 and t4 in timer and gated timer mode. table 7-2 f mod = 33.33 mhz timer input selection t2i / t3i / t4i 000 b 000 b 001 b 010 b 011 b 100 b 101 b 110 b 111 b fm = 1 0 0 0 0 0 0 0 0 prescaler factor 4 8 16 32 64 128 256 512 1024 input frequency 2.08 mhz 4.16 mhz 2.08 mhz 1.04 mhz 521.83 khz 260.41 khz 130.20 khz 65.10 khz 32.55 khz resolution 120 ns 240 ns 480 ns 960 ns 1.92 s 3.84 s 7.68 s 15.36 s 30.72 s period 7.86 ms 15.72 ms 31.45 ms 62.91 ms 125.82 ms 251.6 ms 503 ms 1 s 2.01 s f t3 = f hw_clk bps1 ? 2 r t3 [ms] = f hw_clk [mhz] bps1 ? 2
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 8 micronas figure 7-2 block diagram of core timer t3 in timer mode timer 3 in gated timer mode the gated timer mode for the core timer t3 is selected by setting bit field t3m in register t3con to ? 010 b ? or ? 011 b ? . bit t3m.0 (t3con.3) selects the active level of the gate input. in gated timer mode the same options are available for the input frequency as for the timer mode. however, the input clock to the timer in this mode is gated by the external input line t3in (timer t3 external input); an associated port pin should be configured as input. figure 7-3 block diagram of core timer t3 in gated timer mode core timer tx txeud txude mux exor 1 txud hw_clk f txr : 1 bps1 2 n 0 txi down up/ ueb11196 request interrupt x = 3 core timer tx txeud txude mux xor 1 bps1 txud 2 hw_clk txin f txr : 1 mux 0 txi n down up/ request interrupt ueb11197 txout txotl txoe txm x = 3
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 9 micronas if t3m = ? 010 b ? , the timer is enabled when t3in shows a low level. a high level at this line stops the timer. if t3m = ? 011 b ? , line t3in must have a high level in order to enable the timer. in addition, the timer can be turned on or off by software using bit t3r. the timer will only run, if t3r is set and the gate is active. it will stop, if either t3r is cleared or the gate is inactive. note: a transition of the gate signal at line t3in does not cause an interrupt request. timer 3 in counter mode counter mode for the core timer t3 is selected by setting bit field t3m in register t3con to ? 001 b ? . in counter mode, timer t3 is clocked by a transition at the external input line t3in. the event causing an increment or decrement of the timer can be a positive, a negative, or both a positive and negative transition at this line. bit field t3i in control register t3con selects the triggering transition (see table below). figure 7-4 block diagram of core timer t3 in counter mode table 7-3 core timer t3 (counter mode) input edge selection t3i triggering edge for counter increment/decrement 0 0 0 none. counter t3 is disabled 0 0 1 positive transition (rising edge) on t3in 0 1 0 negative transition (falling edge) on t3in 0 1 1 any transition (rising or falling edge) on t3in 1 x x reserved. do not use this combination ueb11198 txin txi edge select txr core timer tx down up/ txout txotl txoe txeud xor txude mux 1 txud 0 request interrupt txofl x = 3
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 10 micronas for counter operation, a port pin associated to line t3in must be configured as input. the maximum input frequency which is allowed in counter mode is f hw_clk /8 (bps1 = ? 01 ? ). to ensure that a transition of the count input signal which is applied to t3in is correctly recognized, its level should be held high or low for at least 4 f hw_clk cycles (bps1 = ? 01 ? ) before it changes. timer 3 in incremental interface mode incremental interface mode for the core timer t3 is selected by setting bit field t3m in register t3con to ? 110 b ? or ? 111 b ? . in incremental interface mode the two inputs associated with timer t3 (t3in, t3eud) are used to interface to an incremental encoder. t3 is clocked by each transition on one or both of the external input lines which gives 2- fold or 4-fold the resolution of the encoder input. figure 7-5 block diagram of core timer t3 in incremental interface mode the t3i bit field in control register t3con selects the triggering transitions (see table 7- 4 ). in this mode, the sequence of the transitions of the two input signals is evaluated and generates count pulses as well as the direction signal. depending on the chosen incremental interface mode, rotation detection ? 110 b ? or edge detection ? 111 b ? , an interrupt is generated. for the rotation detection, an interrupt will be generated each time the count direction of timer t3 changes. for the edge detection an interrupt will be ueb11199 select edge t3i phase detect t3in t3eud 0 mux 1 t3ud t3 edge xor timer t3 t3 rdir t3r up/ down t3otl t3oe interrupt request t3ude t3out change detection t3 chdir t3m t3m interrupt edge interrupt rotation
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 11 micronas generated each time a count action for timer t3 occurs. count direction, changes in the count direction and count requests are monitored through the status bits t3rdir, t3chdir and t3edge in register t3con. t3 is modified automatically according to the speed and the direction of the incremental encoder. therefore, the contents of the t3 timer always represents the encoder ? s current position. the incremental encoder can be connected directly to the microcontroller without external interface logic. in a standard system, however, comparators will be employed to convert the encoder ? s differential outputs (e.g. a, a ) to digital signals (e.g. a). this greatly increases noise immunity. note: the third encoder output t0, which indicates the mechanical zero position, may be connected to an external interrupt input and trigger a reset of timer t3. figure 7-6 interfacing the encoder to the microcontroller for incremental interface operation the following conditions must be met:  the t3m bit field must be ? 110 b ? or ? 111 b ? .  pins associated with lines t3in and t3eud must be configured as input.  the t3ude bit must be set to enable automatic direction control. table 7-4 core timer t3 (incremental interface mode) input edge selection t3i triggering edge for counter increment/decrement 0 0 0 none. counter t3 stops. 0 0 1 any transition (rising or falling edge) on t3in. 0 1 0 any transition (rising or falling edge) on t3eud. 0 1 1 any transition (rising or falling edge) on any t3 input (t3in or t3eud). 1 x x reserved. do not use this combination. ued11136 - + + - + - a b t0 t3 input t3 input interrupt microcontroller a a b b t0 t0 external encoder signal conditioning
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 12 micronas the maximum input frequency which is allowed in incremental interface mode is f hw_clk / 8 (bps = 01). to ensure that a transition of any input signal is correctly recognized, its level should be held high or low for at least 4 f hw_clk cycles (bps = 01) before it changes. in incremental interface mode the count direction is automatically derived from the sequence in which the input signals change, which corresponds to the rotation direction of the connected sensor. table 7-5 summarizes the possible combinations. the figures below give examples of t3 ? s operation, visualizing count signal generation and direction control. it also shows how input jitter is compensated, which might occur if the sensor rests near to one of its switching points. figure 7-7 evaluation of the incremental encoder signals table 7-5 core timer t3 (incremental interface mode) count direction level on respective other input t3in input t3eud input rising falling rising falling high down up up down low up down down up uet11137 up down up forward jitter backward jitter forward t3in t3eud contents of t3 note: this example shows the timer behavior assuming that t3 counts upon any transition on any input, i.e. t3i = ? 011 b ? .
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 13 micronas figure 7-8 evaluation of the incremental encoder signals note: timer t3, operating in incremental interface mode, automatically provides information on the sensor ? s current position. dynamic information (speed, acceleration, deceleration) may be obtained by measuring the incoming signal periods. auxiliary timers t2 and t4 both auxiliary timers t2 and t4 have exactly the same functionality. they can be configured for timer, gated timer, counter, or incremental interface mode with the same options for the timer frequencies and the count signal as the core timer t3. in addition to these 4 counting modes, the auxiliary timers can be concatenated with the core timer, or they may be used as reload or capture registers in conjunction with the core timer. the individual configuration for the t2 and t4 timers is determined by their bit- addressable control registers t2con and t4con, which are both organized identically. note that functions which are present in all 3 timers of timer block 1 are controlled in the same bit positions and in the same manner in each of the specific control registers. run control for auxiliary timers t2 and t4 can be handled by the associated run control bit t2r, t4r in register t2con/t4con. alternatively, a remote control option (t2rc, t4rc set) may be enabled to start and stop t2/t4 via the run bit t3r of core timer t3. uet11138 up down up forward jitter backward jitter forward t3in t3eud contents of t3 note: this example shows the timer behavior assuming that t3 counts upon any transition on input t3in, i.e. t3i = ? 001 b ? .
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 14 micronas timers t2 and t4 in timer mode or gated timer mode when the auxiliary timers t2 and t4 are programmed to timer mode or gated timer mode, their operation is the same as described for the core timer t3. the descriptions, figures and tables apply accordingly with two exceptions:  there is no txout output line for t2 and t4.  overflow/underflow monitoring is not supported (no output toggle latch). timers t2 and t4 in counter mode in counter mode timers t2 and t4 can be clocked either by a transition at the respective external input line txin, or by a transition of timer t3 ? s output toggle latch t3otl. figure 7-9 block diagram of an auxiliary timer in counter mode the event causing an increment or decrement of a timer can be a positive, a negative, or both a positive and negative transition at either the respective input line, or at the output toggle latch t3otl. bit field txi in the respective control register txcon selects the triggering transition (see table 7-6 ). ueb11200 txi select edge txr auxiliary timer tx interrupt request xor txude txin txeud mux txud 0 1 up/ down x = 2, 4
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 15 micronas note: only state transitions of t3otl which are caused by the overflows/underflows of t3 will trigger the counter function of t2/t4. modifications of t3otl via software will not trigger the counter function of t2/t4. for counter operation, an external pin associated to line txin must be configured as input. the maximum input frequency which is allowed in counter mode is f hw_clk /8 (bps1 = ? 01 ? ). to ensure that a transition of the count input signal which is applied to txin is correctly recognized, its level should be held for at least 4 f hw_clk cycles (bps1 = ? 01 ? ) before it changes. 7.1.1.1 timer concatenation using the output toggle latch t3otl as a clock source for an auxiliary timer in counter mode concatenates the core timer t3 with the respective auxiliary timer. depending on which transition of t3otl is selected to clock the auxiliary timer, this concatenation forms a 32-bit or a 33-bit timer/counter.  32-bit timer/counter : if both positive and negative transitions of t3otl are used to clock the auxiliary timer, this timer is clocked on every overflow/underflow of the core timer t3. thus, the two timers form a 32-bit timer.  33-bit timer/counter : if either a positive or a negative transition of t3otl is selected to clock the auxiliary timer, this timer is clocked on every second overflow/underflow of the core timer t3. this configuration forms a 33-bit timer (16-bit core timer + t3otl + 16-bit auxiliary timer). the count directions of the two concatenated timers are not required to be the same. this offers a wide variety of different configurations. in this case t3 can operate in timer, gated timer or counter mode. table 7-6 auxiliary timer (counter mode) input edge selection t2i/t4i triggering edge for counter increment/decrement x 0 0 none. counter tx is disabled 0 0 1 positive transition (rising edge) on txin 0 1 0 negative transition (falling edge) on txin 0 1 1 any transition (rising or falling edge) on txin 1 0 1 positive transition (rising edge) of output toggle latch t3otl 1 1 0 negative transition (falling edge) of output toggle latch t3otl 1 1 1 any transition (rising or falling edge) of output toggle latch t3otl
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 16 micronas figure 7-10 concatenation of core timer t3 and an auxiliary timer auxiliary timer in reload mode reload mode for the auxiliary timers t2 and t4 is selected by setting bit field txm in the respective register txcon to ? 100 b ? . in reload mode the core timer t3 is reloaded with the contents of an auxiliary timer register, triggered by one of two different signals. the trigger signal is selected the same way as the clock source for counter mode (see table 7-6 ), i.e. a transition of the auxiliary timer ? s input or the output toggle latch t3otl may trigger the reload. note: when programmed for reload mode, the respective auxiliary timer (t2 or t4) stops independent of its run flag t2r or t4r. ues11201 txi txr select edge auxiliary timer tx txir core timer ty tyr tyotl tyoe interrupt request tyout up/down interrupt request x = 2, 4 y = 3 hw_clk f : 1 2 n bps1 tyi ) * note: line ? * ? is only affected by over/underflows of t3, but not by software modifications of t3otl.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 17 micronas figure 7-11 gpt1 auxiliary timer in reload mode upon a trigger signal, t3 is loaded with the contents of the respective timer register (t2 or t4) and the interrupt request flag (t2ir or t4ir) is set. note: when a t3otl transition is selected for the trigger signal, also the interrupt request flag t3ir will be set upon a trigger, indicating t3 ? s overflow or underflow. modifications of t3otl via software will not trigger the counter function of t2/t4. the reload mode triggered by t3otl can be used in a number of different configurations. depending on the selected active transition the following functions can be performed:  if both a positive and a negative transition of t3otl are selected to trigger a reload, the core timer will be reloaded with the contents of the auxiliary timer each time it overflows or underflows. this is the standard reload mode (reload on overflow/ underflow).  if either a positive or a negative transition of t3otl is selected to trigger a reload, the core timer will be reloaded with the contents of the auxiliary timer on every second overflow or underflow.  using this ? single-transition ? mode for both auxiliary timers allows very flexible pulse width modulation (pwm) to be performed. one of the auxiliary timers is programmed to reload the core timer on a positive transition of t3otl, the other is programmed for a reload on a negative transition of t3otl. with this combination the core timer is alternately reloaded from the two auxiliary timers. ues11202 txi select source/edge reload register tx core timer t3 clock input up/down request interrupt interrupt request t3oe t3out txin t3otl ) * x = 2, 4 note: line ? * ? is only affected by over/underflows of t3, but not by software modifications of t3otl.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 18 micronas figure 7-12 shows an example of the generation of a pwm signal using the alternate reload mechanism. t2 defines the high time of the pwm signal (reloaded on positive transitions) and t4 defines the low time of the pwm signal (reloaded on negative transitions). the pwm signal can be output on line t3out if the control bit t3oe is set. with this method the high and low time of the pwm signal can be varied in a wide range. note: the output toggle latch t3otl is accessible via software and may be changed, if required, to modify the pwm signal. however, this will not trigger the reloading of t3. note: an associated port pin linked to line t3out should be configured as output. figure 7-12 gpt1 timer reload configuration for pwm generation note: although it is possible, selecting the same reload trigger event for both auxiliary timers should be avoided. in this case both reload registers would try to load the core timer at the same time. if this combination is selected, t2 is disregarded and the contents of t4 reloaded. ues11203 reload register t2 t2i core timer t3 input clock interrupt request t3otl t3out t3oe t4i reload register t4 request interrupt request interrupt up/down ) * ) * note: lines ? * ? are only affected by over/underflows of t3, but not by software modifications of t3otl.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 19 micronas auxiliary timer in capture mode capture mode for the auxiliary timers t2 and t4 is selected by setting bit field txm in the respective register txcon to ? 101 b ? . in capture mode the contents of the core timer are latched into an auxiliary timer register in response to a signal transition at the respective auxiliary timer ? s external input line txin. the capture trigger signal can be a positive, a negative, or both a positive and a negative transition. the two least significant bits of bit field txi are used to select the active transition (see table in the counter mode section), while the most significant bit, txi.2, is irrelevant for capture mode. it is recommended to keep this bit cleared (txi.2 = ? 0 ? ). note: when programmed for capture mode, the respective auxiliary timer (t2 or t4) stops independent of its run flag t2r or t4r. figure 7-13 auxiliary timer of timer block 1 in capture mode upon a trigger (selected transition) at the corresponding input line txin the contents of the core timer are loaded into the auxiliary timer register and the associated interrupt request flag txir will be set. note: the direction control for t2in and for t4in must be set to ? input', and the level of the capture trigger signal should be kept high or low for at least 4 f hw_clk (bps1 = ? 01 ? ) cycles before it changes, to ensure correct edge detection. ues11204 txi select edge capture register tx core timer t3 clock input up/down request interrupt interrupt request t3oe t3out txin t3otl x = 2, 4
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 20 micronas 7.1.2 functional description of timer block 2 timer block 2 includes the two timers t5 (referred to as the auxiliary timer) and t6 (referred to as the core timer), and the 16-bit capture/reload register caprel. the count direction (up / down) may be programmed by software. the auxiliary timer t6 may be reloaded with the contents of caprel. the toggle bit (t6otl) also supports the concatenation of t6 with auxiliary timer t5, while concatenation of t6 with other timers is provided through line t6ofl. triggered by an external signal, the contents of t5 can be captured in register caprel, and t5 may optionally be cleared. both timer t6 and t5 can count up or down, and the current timer value can be read or modified by the cpu in the non-bitaddressable sfrs t5 and t6. figure 7-14 structure of timer block 2 ues11205 hw_clk f 2 : 1 n mode control t5 capin t3in/ t3eud gpt2 timer t5 u/d mux ct3 control mode t6 hw_clk f : 1 2 n gpt2 timer t6 u/d gpt2 caprel interrupt request request interrupt clear capture interrupt request t6otl clear
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 21 micronas 7.1.2.1 core timer t6 the operation of the core timer t6 is controlled by its bit-addressable control register t6con. timer 6 run bit the timer can be started or stopped by software through bit t6r (timer t6 run bit). setting bit t6r will start the timer, clearing t6r stops the timer. note: when bit t5rc is set, bit t6r will also control (start and stop) auxiliary timer t5. count direction control the count direction of the core timer can be controlled by software. the count direction can be changed regardless of whether the timer is running or not. note: the direction control works the same for core timer t6 and for auxiliary timer t5. therefore the lines and bits are named tx ? timer 6 overflow/underflow monitoring an overflow or underflow of timer t6 will clock the toggle latch t6otl in control register t6con. t6otl can also be set or reset by software. t6otl can be used in conjunction with the timer over/underflows as an input for the counter function of the auxiliary timer t5. timer 6 in timer mode timer mode for the core timer t6 is selected by setting bit field t6m in register t6con to ? 000 b ? . in this mode, t6 is clocked with the module clock divided by a programmable prescaler, which is selected by bit field t6i. the input frequency f t6 for timer t6 and its resolution r t6 are scaled linearly with lower clock frequencies f hw_clk , as can be seen from the following formula: table 7-7 core timer t6 count direction control bit txud count direction 0 count up 1 count down f t6 = f hw_clk bps2 ? 2 r t6 [ms] = f hw_clk [mhz] bps2 ? 2
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 22 micronas figure 7-15 block diagram of core timer t6 in timer mode 7.1.2.2 auxiliary timer t5 the auxiliary timer t5 can be configured for timer mode using the same options for the timer frequencies and the count signal as the core timer t6. in addition to these 3 counting modes, the auxiliary timer can be concatenated with the core timer. the individual configuration for timer t5 is determined by its bit-addressable control register t5con. note that functions present in both timers of timer block 2 are controlled in the same bit positions and manner in each of the specific control registers. run control for auxiliary timer t5 can be handled by the associated run control bit t5r in register t5con. alternatively, a remote control option (t5rc is set) may be enabled to start and stop t5 via the run bit t6r of core timer t6. note: the auxiliary timer has no overflow/underflow toggle latch. therefore, an output line for overflow/underflow monitoring is not provided. count direction control for auxiliary timer the count direction of the auxiliary timer can be controlled in the same way as for the core timer t6. the description and the table apply accordingly. timer t5 in timer mode when the auxiliary timer t5 is programmed to timer mode its operation is the same as described for the core timer t6. the descriptions, figures and tables apply accordingly with one exception:  overflow/underflow monitoring is not supported (no output toggle latch). core timer t6 hw_clk f t6r : 1 bps2 2 n t6i down up/ ueb11206 t6ofl request interrupt t6otl x = 6 t6ud
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 23 micronas 7.1.2.3 timer concatenation using the toggle bit t6otl as a clock source for the auxiliary timer in counter mode concatenates the core timer t6 with the auxiliary timer. depending on which transition of t6otl is selected to clock the auxiliary timer, this concatenation forms a 32-bit or a 33- bit timer/counter.  32-bit timer/counter: if both positive and negative transitions of t6otl are used to clock the auxiliary timer, this timer is clocked on every overflow/underflow of the core timer t6. thus, the two timers form a 32-bit timer.  33-bit timer/counter: if either a positive or a negative transition of t6otl is selected to clock the auxiliary timer, this timer is clocked on every second overflow/underflow of the core timer t6. this configuration forms a 33-bit timer (16-bit core timer + t6otl + 16-bit auxiliary timer). the count directions of the two concatenated timers are not required to be the same. this offers a wide variety of different configurations. in this case t6 can operate in timer, gated timer or counter mode. figure 7-16 concatenation of core timer t6 and auxiliary timer t5 capture/reload register caprel in capture mode this 16-bit register can be used as a capture register for the auxiliary timer t5. this mode is selected by setting bit t5sc in control register t5con. the ct3 bit selects the external input line capin or the input lines of timer t3 as the source for a capture trigger. either a positive, a negative, or both a positive and a negative transition at line capin can be selected to trigger the capture function, or transitions on input t3in or input ues11207 txi txr select edge auxiliary timer tx txir core timer ty tyr tyotl interrupt request up/down up/down interrupt request * x = 5 y = 6 hw_clk f : 1 2 n bps2 tyi tyofl ) note: line ? * ? is only affected by over/underflows of t6, but not by software modifications of t6otl.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 24 micronas t3eud or both inputs t3in and t3eud. the active edge is controlled by bit field ci in register t5con. the maximum input frequency for the capture trigger signal at capin is f hw_clk /2 (bps2 = ? 01 ? ). to ensure that a transition of the capture trigger signal is correctly recognized, its level should be held for at least 2 f hw_clk cycles (bps2 = ? 01 ? ) before it changes. when the timer t3 capture trigger is enabled (ct3 is set), register caprel captures the contents of t5 when transitions of the selected input(s) occur. these values can be used to measure t3 ? s input signals. this is useful e.g. when t3 operates in incremental interface mode, in order to derive dynamic information (speed acceleration) from the input signals. when a selected transition at the external input line capin is detected, the contents of the auxiliary timer t5 are latched into register caprel, and interrupt request flag crir is set. at the same time, timer t5 can be cleared to 0000 h . this option is controlled by bit t5clr in register t5con. if t5clr = ? 0 ? , the contents of timer t5 are not affected by a capture. if t5clr = ? 1 ? , timer t5 is cleared after the current timer value has been latched into register caprel. note: bit t5sc only controls whether a capture is performed or not. if t5sc = ? 0 ? , the input line capin can still be used to clear timer t5 or as an external interrupt input. this interrupt is controlled by the caprel interrupt control register cric. figure 7-17 timer block 2 register caprel in capture mode ueb11208 auxiliary timer t5 up/down interrupt request interrupt request t5clr t5sc t5cc edge select ci mux caprel register capin t3in/ t3eud input clock ct3
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 25 micronas timer block 2 capture/reload register caprel in reload mode this 16-bit register can be used as a reload register for the core timer t6. this mode is selected by setting bit t6sr = ? 1 ? in register t6con. the operation causing a reload in this mode is an overflow or underflow of the core timer t6. when timer t6 overflows from ffff h to 0000 h (when counting up) or when it underflows from 0000 h to ffff h (when counting down), the value stored in register caprel is loaded into timer t6. this will not set the interrupt request flag crir associated with the caprel register. however, interrupt request flag t6ir will be set indicating the overflow/underflow of t6. figure 7-18 timer block 2 register caprel in reload mode timer block 2 capture/reload register caprel in capture-and-reload mode since the reload function and the capture function of register caprel can be enabled individually by bits t5sc and t6sr, by setting both bits the two functions can be enabled simultaneously. this feature can be used to generate an output frequency that is a multiple of the input frequency. ueb11209 up/down input clock caprel register core timer t6 t6sr request interrupt t6ofl
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 26 micronas figure 7-19 timer block 2 register caprel in capture-and-reload mode this combined mode can be used to detect consecutive external events which may occur aperiodically, but where a finer resolution, i.e. more ? ticks ? within the time between two external events, is required. for this purpose, the time between the external operations is measured using timer t5 and the caprel register. timer t5 runs in timer mode counting up with a frequency of e.g. f hw_clk /32. the external operations are applied to line capin. when an external operation occurs, the timer t5 contents are latched into register caprel, and timer t5 is cleared (t5clr = ? 1 ? ). thus, register caprel always contains the correct time between two operations, measured in timer t5 increments. timer t6, which runs in timer mode counting down with a frequency of e.g. f hw_clk /4, uses the value in register caprel to perform a reload on underflow. this means that the value in register caprel represents the time between two underflows of timer t6, now measured in timer t6 increments. since timer t6 runs 8 times faster than timer t5, it will underflow 8 times within the time between two external operations. thus, the underflow signal of timer t6 generates 8 ? ticks ? . upon each underflow, the interrupt request flag t6ir will be set and ueb11210 auxiliary timer t5 up/down interrupt request interrupt request t5clr t5sc t5cc edge select ci mux caprel register capin t3in/ t3eud input clock ct3 up/down input clock core timer t6 t6sr request interrupt t6ofl t6clr
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 27 micronas bit t6otl will be toggled. this signal has 8 times more transitions than the signal which is applied to line capin. a certain deviation of the output frequency is generated by the fact that timer t5 will count actual time units (e.g. t5 running at 1 mhz will capture the value 64 h /100 d for a 10 khz input signal) while t6otl will only toggle on an underflow of t6 (i.e. the transition from 0000 h to ffff h ). in the above mentioned example, t6 would count down from 64 h so the underflow would occur after 101 t6 timing ticks. the actual output frequency then is 79.2 khz instead of the expected 80 khz. this can be solved by activating the capture correction (t5cc = ? 1 ? ). if the capture correction is actived the content of t5 is decremented by 1 before being captured. the deviation described is eliminated (in the example t5 would capture 63 h /99 d and the output frequency would be 80 khz). the underflow signal of timer t6 can furthermore be used to clock one or more of the capcom unit ? s timers, which gives the user the possibility to set compare operations based on a finer resolution than that of the external operations. this connection is accomplished through the t6ofl signal. 7.1.3 gpt registers all available kernel registers are summarized in table 7-8 . function control registers the operating mode of the core timer t3 is configured and controlled by its bit- addressable control register t3con. table 7-8 gpt register summary name reset value description t2con 0000 h timer 2 control register t3con 0000 h timer 3 control register t4con 0000 h timer 4 control register t5con 0000 h timer 5 control register t6con 0000 h timer 6 control register caprel 0000 h capture/reload register t2 0000 h timer 2 register t3 0000 h timer 3 register t4 0000 h timer 4 register t5 0000 h timer 5 register t6 0000 h timer 6 register
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 28 micronas t3con timer 3 control register 1514131211109876543210 t3 rdi r t3 ch dir t3 edg e t3 bps1 t3 otl t3 oe t3 ude t3 ud t3r t3m t3i rh rwh rwh rw rwh rw rw rw rw rw rw field bits type description t3i [2:0] rw timer 3 input parameter selection timer mode see table 7-9 for encoding gated timer see table 7-9 for encoding counter mode see table 7-10 for encoding incremental interface mode see table 7-11 for encoding t3m [5:3] rw timer 3 mode control 000 timer mode 001 counter mode 010 gated timer with gate active low 011 gated timer with gate active high 100 reserved . do not use this combination! 101 reserved . do not use this combination! 110 incremental interface mode (rotation detection) 111 incremental interface mode (edge detection) t3r [6] rw timer 3 run bit 0 timer/counter 3 stops 1 timer/counter 3 runs t3ud [7] rw timer 3 up/down control (when t3ude = ? 0 ? ) 0 counting ? up ? 1 counting ? down ? t3ude [8] rw timer 3 external up/down enable 0 counting direction is internally controlled by sw 1 counting direction is externally controlled by line t3eud
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 29 micronas t3oe [9] rw overflow/underflow output enable 0 t3 overflow/underflow can not be externally monitored 1 t3 overflow/underflow may be externally monitored via t3out t3otl [10] rwh timer 3 output toggle latch toggles on each overflow/underflow of t3. can be set or reset by software. bps1 [12:11] rw timer block prescaler 1 the maximum input frequency 00 for timer 2/3/4 is f hw_clk /8 01 for timer 2/3/4 is f hw_clk /4 10 for timer 2/3/4 is f hw_clk /32 11 for timer 2/3/4 is f hw_clk /16 t3edge [13] rwh timer 3 edge detection the bit is set on each successful edge detection. the bit has to be reset by sw. 0 no count edge was detected 1 a count edge was detected t3chdir [14] rwh timer 3 count direction change the bit is set on a change of the count direction of timer 3. the bit has to be reset by sw. 0 no change in count direction was detected 1 a change in count direction was detected t3rdir [15] rh timer 3 rotation direction 0 timer 3 counts up 1 timer 3 counts down field bits type description
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 30 micronas table 7-9 timer 3 input parameter selection for timer mode and gated mode t3i prescaler for f hw_clk (bps1 = 00) prescaler for f hw_clk (bps1 = 01) prescaler for f hw_clk (bps1 = 10) prescaler for f hw_clk (bps1 = 11) 000 8 4 32 16 001 16 8 64 32 010 32 16 128 64 011 64 32 256 128 100 128 64 512 256 101 256 128 1024 512 110 512 256 2048 1024 111 1024 512 4096 2048 table 7-10 timer 3 input parameter selection for counter mode t3i triggering edge for counter update 000 none. counter t3 is disabled 001 positive transition (raising edge) on t3in 010 negative transition (falling edge) on t3in 011 any transition (raising or falling edge) on t3in 1xx reserved . do not use this combination! table 7-11 timer 3 input parameter selection for incremental interface mode t3i triggering edge for counter update 000 none. counter t3 stops 001 any transition (raising or falling edge) on t3in 010 any transition (raising or falling edge) on t3eud 011 any transition (raising or falling edge) on t3in or t3eud 1xx reserved . do not use this combination!
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 31 micronas t2con t4con timer 2/4 control register 1514131211109876543210 tx rdir tx ch dir tx edg e tx ir dis 0 tx rc tx ude tx ud txr txm txi rh rwh rwh rw r rw rw rw rw rw rw field bits type description txi [2:0] rw timer x input parameter selection timer mode see table 7-12 for encoding gated timer see table 7-12 for encoding counter mode see table 7-13 for encoding incremental interface mode see table 7-14 for encoding txm [5:3] rw timer x mode control (basic operating mode) 000 timer mode 001 counter mode 010 gated timer with gate active low 011 gated timer with gate active high 100 reload mode 101 reserved . do not use this combination! 110 incremental interface mode (rotation detection) 111 incremental interface mode (edge detection) txr [6] rw timer x run bit 0 timer/counter x stops 1 timer/counter x runs txud [7] rw timer x up/down control (when txude = ? 0 ? ) 0 counting ? up ? 1 counting ? down ? txude [8] rw timer x external up/down enable 0 counting direction is internally controlled by sw 1 counting direction is externally controlled by line txeud
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 32 micronas txrc [9] rw timer x remote control 0 timer/counter x is controlled by its own run bit txr 1 timer/counter x is controlled by the run bit of core timer 3 txirdis [12] rw timer x interrupt disable 0 interrupt generation for txchdir and txedge interrupts in incremental interface mode is enabled 1 interrupt generation for txchdir and txedge interrupts in incremental interface mode is disabled txedge [13] rwh timer x edge detection the bit is set on each successful edge detection. the bit has to be reset by sw. 0 no count edge was detected 1 a count edge was detected txchdir [14] rwh timer x count direction change the bit is set on a change of the count direction of timer x. the bit has to be reset by sw. 0 no change in count direction was detected 1 a change in count direction was detected txrdir [15] rh timer x rotation direction 0 timer x counts up 1 timer x counts down field bits type description
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 33 micronas table 7-12 timer x input parameter selection for timer mode and gated mode t3i prescaler for f hw_clk (bps1 = 00) prescaler for f hw_clk (bps1 = 01) prescaler for f hw_clk (bps1 = 10) prescaler for f hw_clk (bps1 = 11) 000 8 4 32 16 001 16 8 64 32 010 32 16 128 64 011 64 32 256 128 100 128 64 512 256 101 256 128 1024 512 110 512 256 2048 1024 111 1024 512 4096 2048 table 7-13 timer x input parameter selection for counter mode txi triggering edge for counter update x 0 0 none. counter tx is disabled 0 0 1 positive transition (raising edge) on txin 0 1 0 negative transition (falling edge) on txin 0 1 1 any transition (raising or falling edge) on txin 1 0 1 positive transition (rising edge) of output toggle latch t3otl 1 1 0 negative transition (falling edge) of output toggle latch t3otl 1 1 1 any transition (rising or falling edge) of output toggle latch t3otl table 7-14 timer x input parameter selection for incremental interface mode txi triggering edge for counter update 000 none. counter tx stops 001 any transition (raising or falling edge) on txin 010 any transition (raising or falling edge) on txeud 011 any transition (raising or falling edge) on txin or txeud 1xx reserved . do not use this combination!
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 34 micronas t6con timer 6 control register 1514131211109876543210 t6 sr t6 clr 0 bps2 t6 otl 00 t6 ud t6r t6m t6i rw rw r rw rwh rw rw rw rw rw rw field bits type description t6i [2:0] rw timer 6 input parameter selection timer mode see table 7-15 for encoding t6m [5:3] rw timer 6 mode control (basic operating mode) 000 timer mode 001 reserved . do not use this combination! 010 reserved . do not use this combination! 011 reserved . do not use this combination! 1xx reserved . do not use this combination! t6r [6] rw timer 6 run bit 0 timer/counter 6 stops 1 timer/counter 6 runs t6ud [7] rw timer 6 up/down control 0 counting ? up ? 1 counting ? down ? t6otl [10] rwh timer 6 output toggle latch toggles on each overflow/underflow of t6. can be set or reset by software. bps2 [12:11] rw timer block prescaler 2 the maximum input frequency 00 for timer 5/6 is f hw_clk /4 01 for timer 5/6 is f hw_clk /2 10 for timer 5/6 is f hw_clk /16 11 for timer 5/6 is f hw_clk /8 t6clr [14] rw timer 6 clear bit 0 timer 6 is not cleared on a capture event 1 timer 6 is cleared on a capture event t6sr [15] rw timer 6 reload mode enable 0 reload from register caprel disabled 1 reload from register caprel enabled
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 35 micronas table 7-15 timer 6 input parameter selection for timer mode and gated mode t6i prescaler for f hw_clk (bps2 = 00) prescaler for f hw_clk (bps2 = 01) prescaler for f hw_clk (bps2 = 10) prescaler for f hw_clk (bps2 = 11) 000 4 2 16 8 001 8 4 32 16 010 16 8 64 32 011 32 16 128 64 100 64 32 256 128 101 128 64 512 256 110 256 128 1024 512 111 512 256 2048 1024 table 7-16 timer 6 input parameter selection for counter mode t6i triggering edge for counter update 000 none. counter t6 is disabled 001 reserved . do not use this combination! 010 reserved . do not use this combination! 011 reserved . do not use this combination! 1xx reserved . do not use this combination!
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 36 micronas t5con timer 5 control register 1514131211109876543210 t5 sr t5 clr ci t5 cc ct3 t5 rc 0 t5 ud t5r t5m t5i rw rw rw rw rw rw rw rw rw rw rw field bits type description t5i [2:0] rw timer 5 input parameter selection timer mode see table 7-17 for encoding counter mode see table 7-18 for encoding t5m [5:3] rw timer 5 mode control (basic operating mode) 000 timer mode 001 counter mode 010 reserved . do not use this combination! 011 reserved . do not use this combination! 1xx reserved . do not use this combination! t5r [6] rw timer 5 run bit 0 timer/counter 5 stops 1 timer/counter 5 runs t5ud [7] rw timer 5 up/down control 0 counting ? up ? 1 counting ? down ? t5rc [9] rw timer 5 remote control 0 timer/counter x is controlled by its own run bit t5r 1 timer/counter 5 is controlled by the run bit of core timer 6 ct3 [10] rw timer 3 capture trigger enable 0 capture trigger from input line capin 1 capture trigger from t3 input lines t5cc [11] rw timer 5 capture correction 0 t5 is just captured without any correction 1 t5 is decremented by 1 before being captured
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 37 micronas ci [13:12] rw register caprel capture trigger selection (depending in bit ct3) 00 capture disabled 01 positive transition (rising edge) on capin or any transition on t3in 10 negative transition (falling edge) on capin or any transition on t3eud 11 any transition (rising or falling edge) on capin or any transition on t3in or t3eud t5clr [14] rw timer 5 clear bit 0 timer 5 is not cleared on a capture operation 1 timer 5 is cleared on a capture operation t5sc [15] rw timer 5 capture mode enable 0 capture into register caprel disabled 1 capture into register caprel enabled table 7-17 timer 5 input parameter selection for timer mode and gated mode t5i prescaler for f hw_clk (bps2 = 00) prescaler for f hw_clk (bps2 = 01) prescaler for f hw_clk (bps2 = 10) prescaler for f hw_clk (bps2 = 11) 00042168 001843216 010 16 8 64 32 011 32 16 128 64 100 64 32 256 128 101 128 64 512 256 110 256 128 1024 512 111 512 256 2048 1024 field bits type description
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 38 micronas 7.1.4 interrupts for a detailed description of the various interrupts see description above. an overview is given with a table 7-19 : . table 7-18 timer 5 input parameter selection for counter mode t5i triggering edge for counter update x00 none. counter t5 is disabled 001 reserved. do not use this combination. 010 reserved. do not use this combination. 011 reserved. do not use this combination. 101 positive transition (rising edge) of output toggle latch t6otl 110 negative transition (falling edge) of output toggle latch t6otl 111 any transition (rising or falling edge) of output toggle latch t6otl table 7-19 peripheral name interrupt sources interrupt interrupt node description timer 2 overflow t2ic interrupt is requested on overflow of timer 2 if counting up. timer 2 underflow t2ic interrupt is requested on underflow of timer 2 if counting down. timer 3 overflow t3ic interrupt is requested on overflow of timer 3 if counting up. timer 3 underflow t3ic interrupt is requested on underflow of timer 3 if counting down. timer 4 overflow t4ic interrupt is requested on overflow of timer 4 if counting up. timer 4 underflow t4ic interrupt is requested on underflow of timer 4 if counting down. timer 5 overflow t5ic interrupt is requested on overflow of timer 5 if counting up. timer 5 underflow t5ic interrupt is requested on underflow of timer 5 if counting down. timer 6 overflow t6ic interrupt is requested on overflow of timer 6 if counting up. timer 6 underflow t6ic interrupt is requested on underflow of timer 6 if counting down.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 39 micronas rotation direction change timer 2 t2ic interrupt is requested on a change of the count direction in the incremental interface mode (t2i = 110). edge detection timer 2 t2ic interrupt is requested on a successful detected edge resulting in a timer count action (t2i = 111). rotation direction change timer 3 t3ic interrupt is requested on a change of the count direction in the incremental interface mode (t3i = 110). edge detection timer 3 t3ic interrupt is requested on a successful detected edge resulting in a timer count action (t3i = 111). rotation direction change timer 4 t4ic interrupt is requested on a change of the count direction in the incremental interface mode (t4i = 110). edge detection timer 4 t4ic interrupt is requested on a successful detected edge resulting in a timer count action (t4i = 111). reload action timer 2 t2ic interrupt is requested on a trigger signal for reloading timer 3 in reload mode (t2i = 100). reload action timer 4 t4ic interrupt is requested on a trigger signal for reloading timer 3 in reload mode (t4i = 100). capture action timer 2 t2ic interrupt is requested on a trigger signal for a capture action to capture timer 3 in timer 2 capture mode (t2i = 101). capture action timer 4 t4ic interrupt is requested on a trigger signal for a capture action to capture timer 3 in timer 4 capture mode (t4i = 101). capture action timer block 2 cric interrupt is requested on a trigger signal for a capture action of timer 5 to register caprel in capture mode (t5sc = 1). table 7-19 peripheral name interrupt sources (cont ? d) interrupt interrupt node description
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 40 micronas 7.2 real-time clock 7.2.1 general description the real time clock (rtc) module of m2 is basically an independent timer chain and counts time ticks. the base frequency of the rtc can be programmed via a reload counter. the rtc can work fully asynchronous to the system frequency (33.33 mhz) and is optimized on a low power consumption. the rtc serves different purposes:  real-time clock to determine the current time and date  cyclic time based interrupt  alarm interrupt for wake up on a defined time  48-bit timer for long term measurements the real time clock module provides three different types of registers: a control register for controlling the rtc s functionality, three data registers for setting the clock divider for rtc base frequency programming and for flexible interrupt generation, and three counter registers that contain the actual time and date. the interrupts are programmed via one interrupt subnode register and via an interrupt node register. figure 7-20 rtc register overview the rtc module consists of a chain of 2 divider blocks, the reloadable 16-bit timer t14 and the 32-bit rtc timer (accessible via registers rtch and rtcl). both timers count up. timer t14 is reloaded with the value of register t14rel on every t14 timer overflow. t14rel is transparent during reload state. figure 7-21 shows the rtc block diagram: rtc interrupt sub node control register uea11139 rtc timer reload register, high word timer t14 reload register rtc control register control registers rtc timer reload register, low word timer t14 count register rtccon rtcrell rtcrelh rtccon t14rel t14 rtcisnc rtcl rtch counter registers data registers rtcrelh rtcrell t14rel rtc timer count register, high word rtc timer count register, low word rtcl rtch t14 interrupt control rtcisnc
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 41 micronas figure 7-21 rtc block diagram rtc control the operating behavior of the rtc module is controlled by the rtccon register. the rtc starts counting by setting the rtcr run bit. after reset, the run bit is set and the rtc automatically starts operation. setting bits t14dec or t14inc allows the t14 timer to be manually and asynchronously decremented or incremented. these bits are cleared by hardware after the decrement/increment operation. the rtc is only reset in case of a hardware reset, so it keeps on running during idle and sleep mode. cyclic interrupt generation the rtc module can generate an interrupt request rtc_int whenever timer t14 overflows and is reloaded. this interrupt request may be used, for example, to provide a system time tick, independent of the cpu clock frequency, without loading the general purpose timers, or to wake up regularly from idle mode. the t14 overflow interrupt (rtc_t14int) cycle time can be adjusted via the timer t14 reload register t14rel. the 32 bit timer (rtcl and rtch) can be divided into smaller reloadable timers. each sub- timer can be programmed for an overflow on different time bases (e.g. second, hour, minute, day). with each timer overflow an rtc interrupt is generated. all these rtc interrupts are ored within the rtc module via the interrupt subnode rtcisnc to one interrupt request rtc_int. this interrupt rtc_int is one source of another interrupt subnode isnc in the interrupt controller. the other interrupt input of subnode isnc is disconnected in the m2. with typical values of t14rel = f448 h , rtcrell = 1018 h and ueb11140 10 bit 10 bit 6 bit 6 bit rtcrell0 rtcrell1 rtcl1 rtcl0 rtc0int rtc1int rtc3int rtc2int rtch2 rtcrel2 6 bit 6 bit 10 bit rtch3 10 bit rtcrel3 interrupt subnode rtc_int t14rel(16 bit) t14(16 bit) rtcr 3 mhz t14_in rtc_t14int
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 42 micronas rtcrelh = fa04 h , counter t14 generates one overflow per millisecond, rtcl0 one per second, rtcl1 one per minute, rtch2 one per hour and rtch3 one per day. 48-bit timer operation the concatenation of the 16-bit reload timer t14 and the 32-bit rtc timer can be regarded as a 48-bit timer which counts with the rtc count input frequency (3 mhz). the reload registers t14rel, rtcrell and rtcrelh should be cleared to get a 48- bit binary timer. however, any other reload values may be used. interrupt subnode rtcisnc all rtc interrupts are connected to one interrupt node via an interrupt subnode. for this interrupt sharing each interrupt source has, in addition to the node enable and request flag its own enable and request flag located in register rtcisnc. after an rtc interrupt (rtc_int) is arbitrated, the interrupt service routine has to check all the enabled sources request flags and run the respective software routine. the request flags have to be deleted by software before leaving the interrupt service routine. reset behavior the rtc registers are only cleared or set by a hardware reset. bit rtcr is set when the hardware is reset. 7.2.2 register description rtccon reset value: 0003 h bit function rtcr rtc run bit ? 0 ? :rtc stops ? 1 ? :rtc runs t14dec decrement t14 timer value setting this bit to 1 effects a decrement of the t14 timer value. the bit is cleared by hardware after decrementation. t14inc increment t14 timer value setting this bit to 1 effects an increment of the t14 timer value. the bit is cleared by hardware after incrementation. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw - - - - - - - - - - - - t14 inc t14 dec 0 rtc r
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 43 micronas note: bit rtcr is set on hardware reset. t14 reset value: 0000 h t14rel reset value: 0000 h rtcl reset value: 0000 h bit function timer14 (15 ? 0) 16 bit timer register timer t14 generates the input clock for the rtc register and the periodic interrupt. bit function timerrel14 (15 ? 0) 16 bit reload register for timer 14 represents the 16 bit reload value for t14 bit function rtcl1 (5 ? 0) low word of 32 bit capture register. rtcl0 (9 ? 0) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw timer14(15 ..0 ) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw timer14rel(15 ..0 ) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rtcl1(5 .. 0) rtcl0(9 .. 0)
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 44 micronas rtch reset value: 0000 h rtcrell reset value: 0000 h rtcrelh reset value: 0000 h bit function rtch3 (9 ? 0) high word of 32 bit capture register. rtch2 (5 ? 0) bit function rtcrell1 (5 ? 0) low word of 32 bit reload register. rtcrell0 (9 ? 0) bit function rtcrelh2 (5 ? 0) high word of 32 bit reload register. rtcrelh3 (9 ? 0) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rtch3(9.. 0) rtch2(5 .. 0) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rtcrell1(5 .. 0) rtcrell0(9 .. 0) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rtcrelh3(9.. 0) rtcrelh2(5 .. 0)
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 45 micronas rtc interrupt subnode control rtcisnc reset value: 0000 h bit function t14ir t14 overflow interrupt request flag ? 0 ? : no request pending. ? 1 ? : this source has raised an interrupt request. t14ie t14 overflow interrupt enable control bit ? 0 ? : interrupt request is disabled. ? 1 ? : interrupt request is enabled. rtcxir rtcx interrupt request flag ? 0 ? : no request pending. ? 1 ? : this source has raised an interrupt request. rtcxie rtcx interrupt enable control bit ? 0 ? : interrupt request is disabled. ? 1 ? : interrupt request is enabled. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw rw rw rw rw - - - - - - rtc 3 ir rtc 3ie rtc 2 ir rtc 2ie rtc 1 ir rtc 1 ie rtc 0 ir rtc 0ie t14 ir t14 ie
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 46 micronas isnc reset value: 0000 h note: the interrupt request flags of both rtc interrupt subnodes have to be cleared by software inside the interrupt service routine. bit function rtcintir rtc interrupt request flag ? 0 ? : no request pending. ? 1 ? : rtc has raised an interrupt request. rtcintie rtc interrupt enable control bit ? 0 ? : interrupt request is disabled. ? 1 ? : interrupt request is enabled. int2ir interrupt request flag of 2nd source disconnected in m2. int2ie 2nd source interrupt enable control bit ? 0 ? : recommended value. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw - - - - - - - - - - - - int2 ie int2 ir rtc int ie rtc int ir rw
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 47 micronas 7.3 asynchronous/synchronous serial interface the asynchronous/synchronous serial interface asc0 provides serial communication between m2 and other microcontrollers, microprocessors or external peripherals. it provides the following features:  full duplex asynchronous operating modes ? 8- or 9-bit data frames, lsb first ? parity bit generation/checking ? one or two stop bits ? baud rate from 2.0625 mbaud to 0.48 baud (@ 33 mhz clock) ? multiprocessor mode for automatic address/data byte detection ? loop-back capability  support for irda data transmission/reception up to max. 115.2 kbaud  autobaud detection unit for asynchronous operating modes ? detection of standard baud rates 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400 baud ? detection of non-standard baud rates ? detection of asynchronous modes 7 bit, even parity; 7 bit, odd parity; 8 bit, even parity; 8 bit, odd parity; 8 bit, no parity ? automatic initialization of control bits and baud rate generator after detection ? detection of a serial two-byte ascii character frame  half-duplex 8-bit synchronous operating mode ? baud rate from 4.125 mbaud to 420 baud (@ 33 mhz clock)  double buffered transmitter/receiver  interrupt generation ? on a transmitter buffer empty condition ? on a transmit last bit of a frame condition ? on a receiver buffer full condition ? on an error condition (frame, parity, overrun error) ? on the start and the end of a autobaud detection figure 7-22 shows a block diagram of the asc with its operating modes (asynchronous and synchronous mode.)
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 48 micronas . figure 7-22 block diagram of the asc0 ueb11141 receive/transmit buffers and shift registers serial port control baud rate timer prescaler/ fractional divider detection autobaud div f coding irda mux decoding irda mux txd rxd 33 mhz 2 3 or serial port control buffers and shift registers receive/transmit baud rate timer f mod txd shift clock rxdo rxdi note: rxdi and rxdo are concatenated in the port logic to pin rxd. asynchronous mode synchronous mode
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 49 micronas figure 7-23 asc register overview the asc0 supports full-duplex asynchronous communication up to 2.08 mbaud and half-duplex synchronous communication up to 4.16 mbaud (@ 33.33 mhz cpu clock). in synchronous mode, data is transmitted or received synchronous to a shift clock which is generated by the microcontroller. in asynchronous mode, 8- or 9-bit data transfer, parity generation, and the number of stop bits can be selected. parity, framing, and overrun error detection is provided to increase the reliability of data transfers. transmission and reception of data is double-buffered. for multiprocessor communication, a mechanism to distinguish address from data bytes is included. testing is supported by a loop-back option. a 13-bit baud rate timer with a versatile input clock divider circuitry provides the asc0 with the serial clock signal. in a special asynchronous mode, the asc0 supports irda data transmission up to 115.2 kbaud with fixed or programmable irda pulse width. a transmission is started by writing to the transmit buffer register s0tbuf (by way of an instruction or a pec data transfer). only the number of data bits which is determined by the selected operating mode, will actually be transmitted, e.g. bits written to positions 9 through 15 of register s0tbuf are always insignificant. data transmission is double-buffered, so a new character may be written to the transmit buffer register, before the transmission of the previous character is complete. this allows the transmission of characters back-to-back without gaps. asc0 receive interrupt control register asc0 receive buffer register (read only) asc0 irda pulse mode and width register uea11142 port 3 open drain control register port 3 direction control register asc0 baud rate generator/reload register asc0 transmit buffer register asc0 transmit interrupt control register asc0 transmit buffer interrupt control register autobaud status register autobaud control register s0tbic abstat abcon odp3 s0bg s0tbuf s0tic dp3 s0ric s0eic s0fdv s0pmw s0rbuf s0con p3 asc0 error interrupt control register asc0 fractional divider regiser asc0 control register port 3 data register p3 odp3 txd0/p3.10 rxd0/p3.11 dp3 ports & direction control alternate functions control registers data registers s0tbuf s0rbuf s0bg s0pmw abstat abcon s0con s0fdv s0tbic s0ric s0eic s0tic interrupt control
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 50 micronas data reception is enabled by the receiver enable bit s0ren. after reception of a character has been completed, the received data and, if provided by the selected operating mode, the received parity bit can be read from the (read-only) receive buffer register s0rbuf. bits in the upper half of s0rbuf which are not valid in the selected operating mode will be read as zeros. data reception is double-buffered, so that reception of a second character may begin before the previously received character has been read out of the receive buffer register. in all modes, receive buffer overrun error detection can be selected through bit s0oen. when enabled, the overrun error status flag s0oe and the error interrupt request line s0eir will be activated if the receive buffer register has not been read when the reception of a second character is complete. the previously received character in the receive buffer is overwritten. the loop-back option (selected by bit s0lb) allows the data currently being transmitted to be received simultaneously in the receive buffer. this may be used to test serial communication routines at an early stage without having to provide an external network. in loop-back mode the alternate input/output functions of the port 3 pins are not necessary. note: serial data transmission or reception is only possible when the baud rate generator run bit s0r is set to ? 1 ? . otherwise the serial interface is idle. do not program the mode control field s0m in register s0con to one of the reserved combinations to avoid unpredictable behavior of the serial interface. 7.3.1 asynchronous operation asynchronous mode supports full-duplex communication, where both transmitter and receiver use the same data frame format and the same baud rate. data is transmitted on pin txd0 and received on pin rxd0. these signals are alternate functions of port 3 pins. irda data transmission/reception supports up to 115.2 kbit/s. figure 7-24 shows the block diagram of the asc0 operating in asynchronous mode.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 51 micronas figure 7-24 asynchronous mode of serial channel asc0 ues11143 13-bit reload register 13-bit baud rate timer 16 f br div f 3 2 fractional divider mux s0fde s0brs s0r 33 mhz serial port control shift clock shift clock s0ren s0fen s0oen s0pen s0lb s0rir s0eir s0tir s0tbir receive int. request transmit int. request transmit buffer int. request error int. request s0m s0str s0fe s0oe s0pe transmit shift register transmit buffer reg. s0tbuf receive buffer register receive shift reg. s0rbuf irda coding mux sampling mux decoding irda mux rxd0 internal bus txd0
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 52 micronas 7.3.1.1 asynchronous data frames 8-bit data frames 8-bit data frames either consist of 8 data bits d7 ? d0 (s0m = ? 001 b ? ), or of 7 data bits d6 ? d0 plus an automatically generated parity bit (s0m = ? 011 b ? ). parity may be odd or even, depending on bit s0odd in register s0con. an even parity bit will be set, if the modulo-2-sum of the 7 data bits is ? 1 ? . an odd parity bit will be cleared in this case. parity checking is enabled via bit s0pen (always off in 8-bit data mode). the parity error flag s0pe will be set along with the error interrupt request flag, if a wrong parity bit is received. the parity bit itself will be stored in bit s0rbuf.7. figure 7-25 asynchronous 8-bit frames 9-bit data frames 9-bit data frames either consist of 9 data bits d8 ? d0 (s0m = ? 100 b ? ), of 8 data bits d7 ? d0 plus an automatically generated parity bit (s0m = ? 111 b ? ) or of 8 data bits d7 ? d0 plus wake-up bit (s0m = ? 101 b ? ). parity may be odd or even, depending on bit s0odd in register s0con. an even parity bit will be set, if the modulo-2-sum of the 8 data bits is ? 1 ? . an odd parity bit will be cleared in this case. parity checking is enabled via bit s0pen (always off in 9-bit data and wake-up mode). the parity error flag s0pe will be set along with the error interrupt request flag, if a wrong parity bit is received. the parity bit itself will be stored in bit s0rbuf.8. d0 lsb 0 start bit 10-/11-bit uart frame d1 d2 8 data bits d4 d3 d5 ued11144 d6 parity bit stop (1st) 1 stop (2nd) bit 1 msb 7 data bits 10-/11-bit uart frame d1 lsb d0 d2 d3 stop (2nd) d5 d4 d6 bit stop (1st) msb d7 bit 11 bit som = 001 som = 011 b b bit start 0
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 53 micronas figure 7-26 asynchronous 9-bit frames in wake-up mode, received frames are only transferred to the receive buffer register if the 9th bit (the wake-up bit) is ? 1 ? . if this bit is ? 0 ? , no receive interrupt request will be activated and no data will be transferred. this feature may be used to control communication in a multi-processor system: when the master processor wants to transmit a block of data to one of several slaves, it first sends out an address byte which identifies the target slave. an address byte differs from a data byte in that the additional 9th bit is a ? 1 ? for an address byte and a ? 0 ? for a data byte, so no slave will be interrupted by a data ? byte ? . an address ? byte ? will interrupt all slaves (operating in 8-bit data + wake-up bit mode), so each slave can examine the 8 lsbs of the received character (the address). the addressed slave will switch to 9-bit data mode (e.g. by clearing bit s0m.0), which enables it to also receive further data bytes (having the wake-up bit cleared). the slaves that were not being addressed remain in 8- bit data + wake-up bit mode, ignoring the following data bytes. irda frames the modulation schemes of irda is based on standard asynchronous data transmission frames. the asynchronous data format in irda mode (s0m = 010 b ) is defined as follows:  1 start bit/8 data bits/1 stop bit the coding/decoding of/to the asynchronous data frames is shown in figure 7-27 . in general, during the irda transmissions, uart frames are encoded into ir frames and vice versa. a low level on the ir frame indicates a ? led off ? state. a high level on the ir frame indicates a ? led on ? state. for a ? 0 ? -bit in the uart frame, a high pulse is generated. for a ? 1 ? -bit in the uart frame, no pulse is generated. the high pulse starts in the middle of a bit cell and has a fixed width of 3/16 of the bit time. the asc0 also allows the length of the irda high pulse to be programmed. furthermore, the polarity of the received irda pulse can be inverted in irda mode. figure 7-27 shows the non-inverted irda pulse scheme. ued11145 0 bit start lsb d0 d1 d2 d3 d4 d5 d6 d7 bit 9 (1st) stop bit (2nd) bit stop 11 9 data bits 11-/12-bit uart frame som = 100 som = 101 som = 111 b b b : bit 9 = parity bit : bit 9 = wake-up bit : bit 9 = data bit d8
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 54 micronas figure 7-27 irda frame encoding/decoding 7.3.1.2 asynchronous transmission asynchronous transmission begins at the next overflow of the divide-by-16 baud rate timer (transition of the baud rate clock f br ), if bit s0r must be set and data has been loaded into s0tbuf. the transmitted data frame consists of three basic elements:  the start bit  the data field (8 or 9 bits, lsb first, including a parity bit, if selected)  the delimiter (1 or 2 stop bits) data transmission is double buffered. when the transmitter is idle, the transmit data loaded into s0tbuf is immediately moved to the transmit shift register thus freeing s0tbuf for the next data to be sent. this is indicated by the transmit buffer interrupt request line s0tbir being activated. s0tbuf may now be loaded with the next data, while transmission of the previous one is still going on. the transmit interrupt request line s0tir will be activated before the last bit of a frame is transmitted, e.g. before the first or the second stop bit is shifted out of the transmit shift register. for alternate data output the transmitter output pin txd0 must be configured. ued11146 8 data bits 01 1 0001101 uart frame bit start stop bit 0 01010 1101 ir frame bit start 8 data bits stop bit bit time 1/2 bittime pulse width = 3/16 bit time (or variable length)
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 55 micronas 7.3.1.3 asynchronous reception asynchronous reception is initiated by a falling edge (1-to-0 transition) on pin rxd0, provided that bits s0r and s0ren are set. the receive data input pin rxd0 is sampled at 16 times the rate of the selected baud rate. a majority decision of the 7th, 8th and 9th sample determines the effective bit value. this avoids erroneous results that may be caused by noise. if the detected value is not equal to ? 0 ? when the start bit is sampled, the receive circuit is reset and waits for the next 1-to-0 transition at pin rxd0. if the start bit proves valid, the receive circuit continues sampling and shifts the incoming data frame into the receive shift register. when the last stop bit has been received, the content of the receive shift register is transferred to the receive data buffer register s0rbuf. simultaneously, the receive interrupt request line s0rir is activated after the 9th sample in the last stop bit time slot (as programmed), regardless whether valid stop bits have been received or not. the receive circuit then waits for the next start bit (1-to-0 transition) at the receive data input pin. the receiver input pin rxd0 must be configured for input. asynchronous reception is stopped by clearing bit s0ren. a currently received frame is completed including the generation of the receive interrupt request and an error interrupt request, if appropriate. start bits that follow this frame will not be recognized. note: in wake-up mode received frames are only transferred to the receive buffer register, if the 9th bit (the wake-up bit) is equal to ? 1 ? . if this bit is equal to ? 0 ? , no receive interrupt request will be activated and no data transferred. irda mode the duration of the irda pulse is normally 3/16 of a bit period. the irda standard also allows the pulse duration to be independent of the baud rate or bit period. in this case the transmitted pulse always has the width corresponding to the 3/16 pulse width at 115.2 kbaud which is 1.67 s. both bit period dependent or fixed irda pulse width generation can be selected. the irda pulse width mode is selected by bit s0irpw, which is located in register s0pwm. in case of a fixed irda pulse width generation, the lower 8 bits in register s0pwm are used to adapt the irda pulse width to a fixed value of e.g. 1.67 s. the fixed irda pulse width is generated by a programmable timer as shown in figure 7-28 .
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 56 micronas figure 7-28 fixed irda pulse generation the irda pulse width can be calculated according to the formulas given in the following table. the name s0pwm in the formulas represents the contents of the reload register s0pwm (bits s0pw0-7), taken as an unsigned 8-bit integer. the content of s0pwm further defines the minimum irda pulse width ( t ipw min ) which is still recognized as a valid irda pulse during a receive operation. this function is independent of the selected irda pulse width mode (fixed or variable) which is defined by bit s0irpw in register s0pwm. the minimum irda pulse width is calculated by a shift right operation of s0pwm bit 7-0 by one bit divided by the cpu clock (33.33 mhz). note: if s0irpw=0 (fixed irda pulse width), sxpwm bit 7-0 must be loaded with a value which assures that t ipw > t ipw min . rxd/txd data path selection in asynchronous modes the data paths for the serial input and output data in asynchronous modes are affected by several control bits in the registers s0con and s0abcon, as shown in figure 7-29 . the synchronous mode operation is not affected by these data path selection capabilities. the input signal from rxd passes an inverter which is controlled by bit abcon_rxinv. the output signal of this inverter is used for the autobaud detection and may bypass the asc_p logic in the echo mode (controlled by bit abcon_abem). furthermore, two multiplexers are in the rxd input signal path to provide the loopback mode capability (controlled by bit con_lb) and the irda receive pulse inversion capability (controlled by bit con_rxdi). s0pwm s0ipwm formulas 1 ? 255 0 1 ued11147 s0pwm 8-bit timer 33 mhz start timer ipw t irda pulse t ipw = 16 x 33 mhz 3 t ipw min = 33 mhz (s0pwm >> 1) t ipw = 33 mhz s0pwm
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 57 micronas depending on the asynchronous operating mode (controlled by bitfield con_m), the asc output signal or the rxd input signal in echo mode (controlled by bit abcon_abem) is switched to the txd output by an inverter (controlled by bit abcon_txinv). figure 7-29 rxd/txd data path in asynchronous modes in echo mode, the transmit output signal of the asc_p3 logic is blocked by the echo mode output multiplexer. figure 7-29 also shows that it is not possible to use an irda coded receiver input signal for autobaud detection. 7.3.2 synchronous operation synchronous mode supports half-duplex communication, basically for simple i/o expansion via shift registers. data is transmitted and received via pin rxd0 while pin txd0 outputs the shift clock. these signals are alternate functions of port pins. synchronous mode is selected with s0m = ? 000 b ? . 8 data bits are transmitted or received synchronous to a shift clock, generated by the internal baud rate generator. the shift clock is only active as long as data bits are transmitted or received. ued11148 mux rxd mux mux coding irda decoding irda asynch. mode logic asc con lb rxdi mux mux mux txd detection abcon autobaud rxinv txinv abem m
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 58 micronas figure 7-30 synchronous mode of serial channel asc0 7.3.2.1 synchronous transmission synchronous transmission begins within 4 state times after data has been loaded into s0tbuf, provided that s0r is set and s0ren = ? 0 ? (half-duplex, no reception). exception: in loop-back mode (bit s0lb in s0con set), s0ren must be set to receive the transmitted byte. data transmission is double buffered. when the transmitter is idle, the transmit data loaded into s0tbuf is immediately moved to the transmit shift register thus freeing s0tbuf for the next data to be sent. this is indicated by the transmit buffer interrupt request line s0tbir being activated. s0tbuf may now be loaded with the next ues11149 13-bit reload register 13-bit baud rate timer 4 f br div f 3 2 mux s0brs s0r 33 mhz serial port control shift clock shift clock s0ren s0lb s0oen s0rir s0eir s0tir s0tbir receive int. request transmit int. request transmit buffer int. request error int. request s0m = 000 s0oe transmit shift register transmit buffer reg. s0tbuf receive buffer register receive shift reg. s0rbuf internal bus f brt b mux 0 1 txd0 rxd0
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 59 micronas data, while transmission of the previous one is still going on. the data bits are transmitted synchronous to the shift clock. after the bit time for the 8th data bit, both pins txd0 and rxd0 will go high, the transmit interrupt request line s0tir is activated, and serial data transmission stops. pin txd0 must be configured for alternate data output in order to support the shift clock. pin rxd0 must also be configured for output during transmission. 7.3.2.2 synchronous reception synchronous reception is initiated by setting bit s0ren = ? 1 ? . if bit s0r = 1, the data applied at pin rxd0 is clocked into the receive shift register synchronous to the clock which is output at pin txd0. after the 8th bit has been moved in, the content of the receive shift register is transferred to the receive data buffer s0rbuf, the receive interrupt request line s0rir is activated, the receiver enable bit s0ren is reset, and serial data reception stops. pin txd0 must be configured for alternate data output in order to support the shift clock. pin rxd0 must be configured as an alternate data input. synchronous reception is terminated by clearing bit s0ren. a currently received byte is completed including the generation of the receive interrupt request and an error interrupt request, if appropriate. writing to the transmit buffer register while a reception is in progress has no effect on reception and will not start a transmission. if a previously received byte has not been read out of the receive buffer register at the time the reception of the next byte is complete, both the error interrupt request line s0eir and the overrun error status flag s0oe will be activated/set, provided the overrun check has been enabled by bit s0oen. 7.3.2.3 synchronous timing figure 7-31 shows timing diagrams of the asc0 synchronous mode data reception and data transmission. in idle state the shift clock is at high level. with the beginning of a synchronous transmission of a data byte, the data is shifted out at pin rxd0 with the falling edge of the shift clock. if a data byte is received through pin rxd0, data is latched with the rising edge of the shift clock. between two consecutive receive or transmit data bytes one shift clock cycle ( f br ) delay is inserted.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 60 micronas figure 7-31 asc0 synchronous mode waveforms 7.3.3 baud rate generation the serial channel asc0 has its own dedicated 13-bit baud rate generator with 13-bit reload capability, allowing baud rate generation to be independent of the gpt timers. the baud rate generator is clocked with the cpu clock. the baud rate timer is counting downwards and can be started or stopped through the baud rate generator run bit s0r in register s0con. each underflow of the timer provides one clock pulse to the serial channel. the timer is reloaded with the value stored in its 13-bit reload register each time it underflows. the resulting clock f brt is again divided according to the operating mode and controlled by the baud rate selection bit s0brs. if s0brs = ? 1 ? , the clock signal is additionally divided to 2/3rd of its frequency (see formulas and table). so the baud rate of asc0 is determined by the cpu clock, the reload value, the value of s0brs and the operating mode (asynchronous or synchronous). uet11150 receive data d0 d1 d2 d3 d4 d5 d6 d7 d0 d1 d2 d3 1. byte 2. byte transmit data d1 d0 d2 d0 d6 1. byte d3 d4 d5 d7 d1 2. byte d2 d3 shift clock continuous transmit timing data bit n+1 data bit n+2 data bit n shift clock transmit data valid data n receive data valid data n+1 valid data n+2 shift latch shift latch shift receive/transmit timing
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 61 micronas register s0bg is the dual-function baud rate generator/reload register. reading s0bg returns the content of the timer (bits 15 ? 13 return zero), while writing to s0bg always updates the reload register (bits 15 ? 13 are insignificant). an auto-reload of the timer with the content of the reload register is performed each time s0bg is written to. however, if s0r = ? 0 ? at the time the write operation to s0bg is performed, the timer will not be reloaded until the first instruction cycle after s0r = ? 1 ? . for a clean baud rate initialization, s0bg should only be written if s0r = ? 0 ? . if s0bg is written with s0r = ? 1 ? , an unpredicted behavior of the asc0 may occur during the running of transmit or receive operations. 7.3.3.1 baud rates in asynchronous mode for asynchronous operation, the baud rate generator provides a clock f brt with 16 times the rate of the established baud rate. every received bit is sampled at the 7th, 8th and 9th cycle of this clock. the clock divider circuitry, which generates the input clock for the 13-bit baud rate timer, is extended by a fractional divider circuitry, which allows the adjustment of more accurate baud rates and the extension of the baud rate range. the baud rate of the baud rate generator depends on the following bits and register values:  cpu clock  selection of the baud rate timer input clock f div by bits s0fde and s0brs  if bit s0fde = 1 (fractional divider): value of register s0fdv  value of the 13-bit reload register s0bg the output clock of the baud rate timer with the reload register is the sample clock in the asynchronous modes of the asc0. for baud rate calculations, this baud rate clock f br is derived from the sample clock f div by a division of 16.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 62 micronas figure 7-32 asc0 baud rate generator circuitry in asynchronous modes using the fixed input clock divider the baud rate for asynchronous operation of serial channel asc0, when using the fixed input clock divider ratios (s0fde = 0) and the required reload value for a given baud rate, can be determined by the following formulas: s0bg represents the content of the reload register s0bg, taken as an unsigned 13-bit integer. the maximum baud rate that can be achieved by the asynchronous modes when using the two fixed clock dividers and a cpu clock of 33.33 mhz is 1041.66 kbaud. the table s0fde s0brs s0bg formula 000 ? 8191 1 ues11151 13-bit reload register 13-bit baud rate timer 16 f br div f 3 2 fractional divider mux s0fde s0brs s0r 33 mhz f brt baud rate clock sample clock s0fde s0brs selected divider 0 0 1x 1 0 2 3 fractional divider 32 x (s0bg+1) baud rate = 33 mhz 32 x baud rate 33 mhz s0bg = - 1 48 x (s0bg+1) baud rate = 33 mhz 48 x baud rate 33 mhz s0bg = - 1
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 63 micronas below lists various commonly used baud rates, together with the required reload values and the deviation errors compared to the intended baud rate. note: s0fde must be equal to 0 to achieve the baud rates in the table above. the deviation errors given in the table are rounded. using a baud rate crystal will provide correct baud rates without deviation errors. using the fractional divider when the fractional divider is selected, the input clock f div for the baud rate timer is derived from the cpu clock by a programmable divider. if s0fde = 1, the fractional divider is activated, it divides 33.33 mhz by a fraction of n/512 for any value of n from 0 to 511. if n = 0, the divider ratio is 1 which means that f div =33.33 mhz. s0bg represents the content of the reload register s0bg, taken as an unsigned 13-bit integer. s0fdv represents the content of the fractional divider register taken as an unsigned 9- bit integer. baud rate s0brs = ? 0 ? , f mod = 33.33 mhz s0brs = ? 1 ? , f mod = 33.33 mhz deviation error reload value deviation error reload value 1041.66 kbaud ? 0000 h ?? 694.4 kbaud ??? 0000 h 19.2 kbaud + 0.4%/ ? 1.3% 0035 h /0036 h +0.5%/ ? 2.2% 0023 h /0024 h 9600 baud + 0.4%/ ? 0.4% 006b h /006c h +0.5%/ ? 0.9% 0047 h /0048 h 4800 baud + 0.0%/ ? 0.4% 00d8 h /00d9 h +0.5%/ ? 0.2% 008f h /0090 h 2400 baud + 0.0%/ ? 0.2% 01b1 h /01b2 h +0.1%/ ? 0.2% 0120 h /0121 h 1200 baud + 0.0%/ ? 0.1% 0363 h /0364 h +0.1%/ ? 0.0% 0241 h /0242 h 110 baud + 0.0%/ ? 0.0% 24fc h /24fd h +0.0%/ ? 0.0% 18a8 h /18a9 h s0fde s0brs s0bg s0fdv formula 1 ? 1 ? 8191 1 ? 511 0 s0fdv 16 x (s0bg+1) baud rate = 33mhz 512 x 16 x (s0bg+1) baud rate = 33mhz
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 64 micronas 7.3.3.2 baud rates in synchronous mode for synchronous operation, the baud rate generator provides a clock with 4 times the rate of the established baud rate (see figure 7-33 ). figure 7-33 asc0 baud rate generator circuitry in synchronous mode the baud rate for synchronous operation of serial channel asc0 can be determined by the formulas as shown in the following table. s0bg represents the content of the reload register, taken as unsigned 13-bit integers. the maximum baud rate that can be achieved in synchronous mode when using a cpu clock of 33.33 mhz is 4.166 mbaud. 7.3.4 autobaud detection the autobaud detection unit provides an ability to recognize the mode and the baud rate of an asynchronous input signal at rxd. generally, the baud rates to be recognized should be known by the application. with this knowledge, a set of nine baud rates can always be detected. the autobaud detection unit is not designed to calculate a baud rate of an unknown asynchronous frame. s0brs s0bg formula 00 ? 8191 1 ues11152 13-bit reload register 13-bit baud rate timer 4 f br div f 3 2 mux s0brs s0r 33 mhz f brt sample clock s0brs selected divider 1 0 2 3 shift/ 8 x (s0bg+1) baud rate = 33 mhz 8 x baud rate 33 mhz s0bg = - 1 12 x (s0bg+1) baud rate = 33 mhz 12 x baud rate 33mhz s0bg = - 1
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 65 micronas figure 7-34 shows how the autobaud detection unit of the asc is integrated into its asynchronous mode configuration. the rxd data line is an input of the autobaud detection unit. the clock f div , which is generated by the fractional divider, is used by the autobaud detection unit as a time base. after successful recognition of the baud rate and asynchronous operating mode of the rxd data input signal, bits in the con register and the value of the bg register in the baud rate timer are set to the appropriate values, and the asc_p3 can start immediately with the reception of serial input data. figure 7-34 asc_p3 asynchronous mode block diagram the following sequence must be generally executed to start the operation of the autobaud detection unit:  definition of the baud rates to be detected: standard or non-standard baud rates  programming of the prescaler/fractional divider to select a specific value of f div  starting the prescaler/fractional divider (setting con_r)  preparing the interrupt system of the cpu  enabling the autobaud detection (setting abcon_ en and the interrupt enable bits in abcon for interrupt generation, if required)  polling interrupt request flag or waiting for the autobaud detection interrupt 7.3.4.1 serial frames for autobaud detection the autobaud detection of the asc_p3 is based on the serial reception of a specific two- byte serial frame. this serial frame is build up by the two ascii bytes ? at ? or ? at ? ( ? at ? or ? at ? are not allowed). both byte combinations can be detected in five types of asynchronous frames. figure 7-35 and figure 7-36 show the serial frames which are least detected. ueb11153 receive/transmit buffers and shift registers serial port control baud rate timer prescaler/ fractional divider detection autobaud div f f mod coding irda mux decoding irda mux txd rxd asynchronous mode
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 66 micronas note: some other two-byte combinations will also be defined. figure 7-35 two-byte serial frames with ascii ? at ? 1 1 10 0 0 0 0 1 11 10 1 01 00 0 8 bit, odd parity start 1 0001 ? a ? = 61 h 0 8 bit, even parity start 1 start ? a ? = 61 0 01 0 h 1 1 parity stop 1001 start 0 0 start parity stop 10 11 stop start 00 0111 h ? t ? = 74 ued11154 parity stop 011 h 1 0 ? t ? = 74 1 1 parity stop 0 0 1 stop ? a ? = 61 0 8 bit, no parity start 1 ? a ? = 61 h 000 h 1 0 7 bit, odd parity 7 bit, even parity start 1 ? a ? = 61 00 h 01 0 ? t ? = 74 0 ? t ? = 74 ? t ? = 74 start parity stop 10 1 001 start parity stop 111 001 parity stop h h 1111 1 parity stop h 1110 1
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 67 micronas figure 7-36 two-byte serial frames with ascii ? at ? 1 1 00 0 0 0 0 1 1 10 10 01 00 0 8 bit, odd parity start 1 0000 ? a ? = 41 h 0 8 bit, even parity start 1 start ? a ? = 41 0 00 0 h 1 1 parity stop 1011 start 0 0 start parity stop 10 01 stop start 00 0101 h ? t ? = 54 ued11155 parity stop 001 h 1 0 ? t ? = 54 1 0 parity stop 1 0 1 stop ? a ? = 41 0 8 bit, no parity start 1 ? a ? = 41 h 00 h 00 0 7 bit, odd parity 7 bit, even parity start 1 ? a ? = 41 00 h 00 0 ? t ? = 54 0 ? t ? = 54 ? t ? = 54 start parity stop 11 1 001 start parity stop 101 001 parity stop h 10 h 10 1 parity stop h 1011 1
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 68 micronas 7.3.4.2 baud rate selection and calculation the autobaud detection requires some calculations concerning the programming of the baud rate generator and the baud rates to be detected. two steps must be considered:  defining the baud rate(s) to be detected  programming of the baud rate timer prescaler - setup of the clock rate of f div in general, the baud rate generator of the asc in asynchronous mode is built up of two parts:  the clock prescaler part which derives f div from f mod  the baud rate timer part which generates the sample clock f brt and the baud rate clock f br prior to an autobaud detection, the prescaler part has to be set up by the cpu while the baud rate timer (register bg) is automatically initialized with a 13-bit value (br_value) after a successfull autobaud detection. for the subsequent calculations, the fractional divider is used (con_fde = 1). note: it is also possible to use the fixed divide-by-2 or divide-by-3 prescaler. but the fractional divider allows for a more precise adaption of f div to the required value. standard baud rates for standard baud rate detection the baud rates as shown in table 7-20 can be detected. therefore, the output frequency f div of the asc baud rate generator must be set to a frequency derived from the system, clocked (33 mhz) in a way that it is equal to 11.0592 mhz. the value to be written into register fdv is the nearest integer value which is calculated according the following formula: table 7-20 defines the nine standard baud rates (br0 - br8) which can be detected for f div = 11.0592 mhz. fdv = 512  11.0592 mhz 33 mhz
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 69 micronas according to table 7-20 a baud rate of 9600 baud is achieved when register bg is loaded with a value of 047 h , assuming that f div has been set to 11.0592 mhz. table 7-20 also lists a divide factor d f which is defined with the following formula: this divide factor d f defines a fixed relationship between the prescaler output frequency f div and the baud rate to be detected during the autobaud detection operation. this means, that changing f div results in a totally different baud rate table in terms of baud rate values. for the baud rates to be detected, the following relations are always valid: ? br0 = f div /48 d , br1 = f div /96 d , ? up to br8 = f div /9216 d , a requirement for detecting standard baud rates up to 230.400 kbaud, is the f div minimum value of 11.0592 mhz. with the value fd_value in register fdv, the fractional divider f div is adapted to the system clock frequency 33 mhz. table 7-21 defines the deviation of the standard baud rates when using autobaud detection depending on the system f mod . note: if the deviation of the baud rate after autobaud detection is too high, the baud rate generator (fractional divider fdv and reload register bg) can be reprogrammed if required to get a more precise baud rate with less error. table 7-20 autobaud detection using standard baud rates ( f div = 11.0592 mhz) baud rate numbering detectable standard baud rate divide factor d f bg is loaded after detection with value br0 230.400 kbaud 48 2 = 002 h br1 115.200 kbaud 96 5 = 005 h br2 57.600 kbaud 192 11 = 00b h br3 38.400 kbaud 288 17 = 011 h br4 19.200 kbaud 576 35 = 023 h br5 9600 baud 1152 71 = 047 h br6 4800 baud 2304 143 = 08f h br7 2400 baud 4608 287 = 11f h br8 1200 baud 9216 575 = 23f h table 7-21 standard baud rates - deviations and errors for autobaud detection f mod fdv error in f div 33 mhz 172 + 0.24% baud rate = f div d f
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 70 micronas non-standard baud rates due to the relationship between br0 to br8 in table 7-20 concerning the divide factor d f other baud rates than the standard ones can also be selected. for example, if a baud rate of 50 kbaud has to be detected, br2 is e.g. defined as baud rate for the 50 kbaud detection. this further results in: ? f div = 50 kbaud ? d f @br2 = 50 kbaud ? 192 = 9.6 mhz therefore, depending on the system clock frequency, the value of the fractional divider (register fdv must be set according the formula in this example: using this selection ( f div = 9.6 mhz), the detectable baud rates start at 200 kbaud (br0) down to 1042 baud (br8). table 7-22 shows the baud rate table for this example. 7.3.4.3 overwriting registers on successful autobaud detection with a successful autobaud detection, some bits in register con and bg are automatically set to a value which corresponds to the mode and baud rate of the detected serial frame conditions. in control register con the mode control bits con_m and the parity select bit con_odd are overwritten. register bg is loaded with the 13- bit reload value for the baud rate timer. table 7-22 autobaud detection using non-standard baud rates ( f div = 9.6 mhz) baud rate numbering detectable non- standard baud rates divide factor d f bg is loaded after detection with value br0 200.000 kbaud 48 2 = 002 h br1 100.000 kbaud 96 5 = 005 h br2 50 kbaud 192 11 = 00b h br3 33.333 kbaud 288 17 = 011 h br4 16.667 kbaud 576 35 = 023 h br5 8333 baud 1152 71 = 047 h br6 4167 baud 2304 143 = 08f h br7 2083 baud 4608 287 = 11f h br8 1047 baud 9216 575 = 23f h fdv = 512 x f div 33 mhz with f div = 9.6 mhz
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 71 micronas 7.3.5 asc hardware error detection capabilities to improve the safety of serial data exchange, the serial channel asc0 provides an error interrupt request flag, which indicates the presence of an error, and three (selectable) error status flags in register s0con, which indicate which error has been detected during reception. upon completion of a reception, the error interrupt request line s0eir will be activated simultaneously with the receive interrupt request line s0rir if one or more of the following conditions are met:  the framing error detection enable bit s0fen is set and any of the expected stop bits are not high, the framing error flag s0fe is set, indicating that the error interrupt request is due to a framing error (asynchronous mode only).  if the parity error detection enable bit s0pen is set in the mode where a parity bit is received, and the parity check on the received data bits proves false, the parity error flag s0pe is set, indicating that the error interrupt request is due to a parity error (asynchronous mode only).  if the overrun error detection enable bit s0oen is set and the last character received was not read out of the receive buffer by software or pec transfer at the time the reception of a new frame is complete, the overrun error flag s0oe is set, indicating that the error interrupt request is due to an overrun error (asynchronous and synchronous mode). table 7-23 autobaud detection overwrite values for the con register detected parameters con_m con_odd bg_br_value operating mode 7 bit, even parity 7 bit, odd parity 8 bit, even parity 8 bit, odd parity 8 bit, no parity 0 1 1 0 1 1 1 1 1 1 1 1 0 0 1 0 1 0 1 0 ? baud rate br0 br1 br2 br3 br4 br5 br6 br7 br8 ?? 2 = 002 h 5= 005 h 11 = 00b h 17 = 011 h 35 = 023 h 71 = 047 h 143 = 08f h 287 = 11f h 575 = 23f h
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 72 micronas 7.3.6 interrupts six interrupt sources are provided for serial channel asc0. line s0tic indicates a transmit interrupt, s0tbic indicates a transmit buffer interrupt, s0ric indicates a receive interrupt and s0eic indicates an error interrupt of the serial channel. the autobaud detection unit provides two additional interrupts, the abstir start of autobaud operation interrupt and the abdetir autobaud detected interrupt. the interrupt output lines s0tbir, s0tir, s0rir, and s0eir are activated (active state) for two periods of the module clock f mod (33.33 mhz). the cause of an error interrupt request (framing, parity, overrun error) can be identified by the error status flags s0fe, s0pe, and s0oe which are located in control register s0con. note: in contrary to the error interrupt request line s0eir, the error status flags s0fe/ s0pe/s0oe are not reset automatically but must be cleared by software. for normal operation (e.g. besides the error interrupt) the asc0 provides three interrupt requests to control data exchange via this serial channel:  s0tbir is activated when data is moved from s0tbuf to the transmit shift register.  s0tir is activated before the last bit of an asynchronous frame is transmitted, or after the last bit of a synchronous frame has been transmitted.  s0rir is activated when the received frame is moved to s0rbuf. while the task of the receive interrupt handler is quite clear, the transmitter is serviced by two interrupt handlers. this has its advantages for the servicing software. for single transfers it is sufficient to use the transmitter interrupt (s0tir), which indicates that the previously loaded data, except for the last bit of an asynchronous frame, has been transmitted. for multiple back-to-back transfers it is necessary to wait to load the last piece of data until the last bit of the previous frame has been transmitted. in asynchronous mode this leaves just one bit-time for the handler to respond to the transmitter interrupt request, in synchronous mode it is impossible. using the transmit buffer interrupt (s0tbir) to reload transmitted data gives enough time to transmit a complete frame for the service routine, as s0tbuf may be reloaded while the previous data is still being transmitted. the abstir start of autobaud operation interrupt is generated whenever the autobaud detection unit is enabled (aben, abdeten and absten set), and a start bit has been detected at rxd. in this case abstir is generated during autobaud detection whenever a start bit is detected. the abdetir autobaud detected interrupt is always generated after recognition of the second character of the two-byte frame, after a successful autobaud detection. if abcon_fcdeten is set the abdetir autobaud detected interrupt is also generated after the recognition of the first character of the two-byte frame.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 73 micronas figure 7-37 asc0 interrupt generation as shown in figure 7-37, s0tbir is an early trigger for the reload routine, while s0tir indicates the completed transmission. software using handshake therefore should rely on s0tir at the end of a data block to make sure that all data has really been transmitted. 7.3.7 register description the operating mode of the serial channel asc0 is controlled by its control register s0con. this register contains control bits for mode and error check selection, and status flags for error identification. s0con control registe r 1514131211109876543210 r lb brs odd fde oe fe pe oen fen pen / rxd i ren stp m ued11156 start idle start stop start stop stop idle s0tbir s0tbir s0tbir s0tir s0tir s0tir s0rir s0rir s0rir asynchronous mode s0rir s0tbir synchronous mode idle s0tbir s0tir s0rir s0tbir s0tir s0rir s0tir idle
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 74 micronas field bits type value description m 2-0 rwh 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 mode selection 8-bit data sync. operation 8-bit data async. operation irda mode, 8-bit data async. operation 7-bit data + parity async. operation 9-bit data async. operation 8-bit data + wake up bit async. operation reserved. do not use this combination! 8-bit data + parity async. operation bits are set/cleared by hardware after a successful autobaud detection operation. stp 3rw 0 1 number of stop bit selection one stop bit two stop bits ren 4rwh 0 1 receiver enable control receiver disabled receiver enabled bit can be affected during autobaud detection operation when bit aben_auren is set. bit is reset by hardware after reception of byte in synchronous mode. pen rxdi 5rw 0 1 0 1 parity check enable/ irda input inverter enable all asynchronous modes without irda mode: ignore parity check parity only in irda mode (m = 010): rxd input is not inverted rxd input is inverted fen 6rw 0 1 framing check enable (async. modes only) ignore framing errors check framing errors oen 7rw 0 1 overrun check enable ignore overrun errors check overrun errors
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 75 micronas pe 8rwh ? parity error flag set by hardware on a parity error (pen = ? 1 ? ). must be reset by software. fe 9rwh ? framing error flag set by hardware on a framing error (fen = ? 1 ? ). must be reset by software. oe 10 rwh ? overrun error flag set by hardware on an overrun error (oen = ? 1 ? ). must be reset by software. fde 11 rw 0 1 fractional divider enable fractional divider disabled fractional divider is enabled and used as prescaler for baud rate timer (bit brs is don ? t care). odd 12 rwh 0 1 parity selection even parity selected (parity bit set on odd number of ? 1 ? s in data) odd parity selected (parity bit set on even number of ? 1 ? s in data) bit is be set/cleared by hardware after a successful autobaud detection operation. brs 13 rw 0 1 baud rate selection baud rate timer prescaler divide-by-2 selected baud rate timer prescaler divide-by-3 selected brs is don ? t care if fde = 1 (fractional divider enabled) lb 14 rw 0 1 loop-back mode enable loop-back mode disabled loop-back mode enabled r 15 rw 0 1 baud rate generator run control baud rate generator disabled (asc_p inactive) baud rate generator enabled bg should only be written if r = ? 0 ? . field bits type value description
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 76 micronas the autobaud control register abcon is used to control the autobaud detection operation. it contains its general enable bit, the interrupt enable control bits, and data path control bits . s0abcon autobaud control register 1514131211109876543210 0000 rx inv tx inv abem 0 0 0 fc det en ab det en abs t en aur en ab en field bits type value description aben 0rwh 0 1 autobaud detection enable autobaud detection is disabled autobaud detection is enabled aben is reset by hardware after a successful autobaud detection; (with the stop bit detection of the second character). resetting aben by software if it was set aborts the autobaud detection. auren 1rw 0 1 automatic autobaud control of con_ren con_ren is not affected during autobaud detection con_ren is cleared (receiver disabled) when aben and auren are set together. con_ren is set (receiver enabled) after a successful autobaud detection (with the stop bit detection of the second character). absten 2rw 0 1 start of autobaud detection interrupt enable start of autobaud detection interrupt disabled start of autobaud detection interrupt enabled abdeten 3rw 0 1 autobaud detection interrupt enable autobaud detection interrupt disabled autobaud detection interrupt enabled
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 77 micronas the autobaud status register abstat indicates the status of the autobaud detection operation. fcdeten 4rw 0 1 first character of two-byte frame detected enable autobaud detection interrupt abdetir becomes active after the two-byte frame recognition autobaud detection interrupt abdetir becomes active after detection of the first and second byte of the two-byte frame. abem 8-9 rw 0 0 0 1 1 0 1 1 autobaud echo mode enable in echo mode the serial data at rxd is switched to txd output. echo mode disabled echo mode is enabled during autobaud detection echo mode is always enabled reserved txinv 10 rw 0 1 transmit inverter enable transmit inverter disabled transmit inverter enabled rxinv 11 rw 0 1 receive inverter enable receive inverter disabled receive inverter enabled field bits type value description
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 78 micronas s0abstat autobaud status register 1514131211109876543210 00000000000 det wai t scc det scs det fcc det fcs det field bits type value description fcsdet 0rwh 0 1 first character with small letter detected no small ? a ? character detected small ? a ? character detected bit is cleared by hardware when abcon_aben is set or if fccdet or scsdet or sccdet is set. bit can be also cleared by software. fccdet 1rwh 0 1 first character with capital letter detected no capital ? a ? character detected capital ? a ? character detected bit is cleared by hardware when abcon_aben is set or if fcsdet or scsdet or sccdet is set. bit can be also cleared by software. scsdet 2rwh 0 1 second character with small letter detected no small ? t ? character detected small ? t ? character detected bit is cleared by hardware when abcon_aben is set or if fcsdet or fccdet or sccdet is set. bit can be also cleared by software.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 79 micronas note: scsdet or sccdet are set when the second character has been recognized. con_aben is reset, and abdetir set, after scsdet or sccdet have seen set. the baud rate timer reload register bg contains the 13-bit reload value for the baud rate timer in asynchronous and sychronous mode. sccdet 3rwh 0 1 second character with capital letter detected no capital ? t ? character detected capital ? t ? character detected bit is cleared by hardware when abcon_aben is set or if fcsdet or fccdet or scsdet is set. bit can be also cleared by software. detwait 4rwh 0 1 autobaud detection is waiting either character ? a ? , ? a ? , ? t ? , or ? t ? has been detected. the autobaud detection unit waits for the first ? a ? or ? a ? bit is cleared when either fcsdet or fccdet is set ( ? a ? or ? a ? detected). bit can be also cleared by software. detwait is set by hardware when abcon_aben is set. field bits type value description
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 80 micronas the fractional divider register fdv contains the 9-bit divider value for the fractional divider (asynchronous mode only). it is also used for reference clock generation of the autobaud detection unit. the irda pulse mode and width register pmw contains the 8-bit irda pulse width value and the irda pulse width mode select bit. this register is only required in the irda operating mode. s0bg baud rate timer/reload register 1514131211109876543210 0 0 0 br_value field bits type value description br_value 12-0 rw all baud rate timer/reload register value reading bg returns the 13-bit content of the baud rate timer (bits 15 ? 13 return 0); writing bg loads the baud rate timer reload register (bits 15 ? 13 are don ? t care). bg should only be written if con_r = ? 0 ? . s0fdv fractional divider register 1514131211109876543210 0000000 fd_value field bits type value description fd_value 8-0 rw all fractional divider register value fdv contains the 9-bit value n of the fractional divider which defines the fractional divider ratio: n/512 n = 0-511). with n = 0, the fractional divider is switched off (input = output frequency, f div = f mod ).
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 81 micronas the transmitter buffer register tbuf contains the transmit data value in asynchronous and synchronous modes. s0pmw irda pulse mode/width register 1514131211109876543210 0000000irp w pw_value field bits type value description pw_value 7-0 rw all irda pulse width value pw_value is the 8-bit value n, which defines the variable pulse width of an irda pulse. depending on the asc_p input frequency f mod , this value can be used to adjust the irda pulse width to value which is not equal 3/16 bit time (e.g. 1.6 s). irpw 8rw 0 1 irda pulse width mode control irda pulse width is 3/16 of the bit time irda pulse width is defined by pw_value
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 82 micronas the receiver buffer register rbuf contains the receive data value in asynchronous and synchronous modes. s0tbuf transmitter buffer register 1514131211109876543210 0000000 td_value field bits type value description td_value 8-0 rw all transmit data register value tbuf contains the data to be transmitted in asynchronous and synchronous operating mode of the asc_p. data transmission is double buffered, therefore, a new value can be written to tbuf before the transmission of the previous value is complete. s0rbuf transmitter buffer register 1514131211109876543210 0000000 rd_value field bits type value description rd_value 8-0 rw all receive data register value rbuf contains the received data bits and, depending on the selected mode, the parity bit in asynchronous and synchronous operating mode of the asc_p. in asynchronous operating mode with m = 011 (7-bit data + parity), the received parity bit is written into rd7. in asynchronous operating mode with m = 111 (8-bit data + parity) the received parity bit is written into rd8.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 83 micronas 7.4 high speed synchronous serial interface  master and slave mode operation ? full-duplex or half-duplex operation  flexible data format ? programmable number of data bits: 2 to 16 bit ? programmable shift direction: lsb or msb shift first ? programmable clock polarity: idle low or high state for the shift clock ? programmable clock/data phase: data shift with leading or trailing edge of sclk  baud rate generation from 12.5 mbaud to 190.7 baud (@ 25 mhz module clock)  interrupt generation ? on a transmitter empty condition ? on a receiver full condition ? on an error condition (receive, phase, baud rate, transmit error)  three pin interface ? flexible ssc0 pin configuration the high speed synchronous serial interface ssc0 provides serial communication between m2 and other microcontrollers, microprocessors or external peripherals. it is compatible with the ssc0 of the referred c161ri device with the following extensions:  maximum ssc clock in master mode: f sclk max. ? 16.5 mhz. maximum ssc clock in slave mode: f sclk max. ? 8.25 mhz.  reload value 0000 h is allowed in master mode.  because of the symmetric ssc clock requirement in master mode (50% duty cycle), the divide-by-2 prescaler is required.  the counter of the baud rate generator is only active (running) during a transmit or receive operation.  the transmit interrupt becomes active when a transmission starts. the ssc0 registers can be basically divided into three types of registers as shown in figure 7-38 .
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 84 micronas figure 7-38 sfrs and port pins associated with the ssc0 the ssc0 supports full-duplex and half-duplex synchronous communication up to 16.5 mbaud (@ 33.33 mhz module clock). the serial clock signal can be generated by the ssc0 itself (master mode), or received from an external master (slave mode). data width, shift direction, clock polarity and phase are programmable. this allows communication with spi-compatible devices. transmission and reception of data is double-buffered. a 16-bit baud rate generator provides the ssc with a separate serial clock signal. the high-speed synchronous serial interface can be configured in a very flexible way, so it can be used with other synchronous serial interfaces, serve for master/slave or multimaster interconnections or operate compatible with the popular spi interface. so it can be used to communicate with shift registers (i/o expansion), peripherals (e.g. eeproms etc.) or other controllers (networking). the ssc0 supports half-duplex and full-duplex communication. data is transmitted or received on pins mtsr0 (master transmit/slave receive) and mrst0 (master receive/slave transmit). the clock signal is output or input on pin sclk0. these pins are alternate functions of port pins. p3 ssccon sscric ssceic sscrb port 3 direction control register ssc transmit buffer register (write only) ssc transmit interrupt control register port 3 open drain control register ssc baud rate generator/reload register sscbr ssctb ssctic odp3 dp3 ssc receive interrupt control register ssc error interrupt control register ssc receive buffer register (read only) ssc control register port 3 data register uea11157 control registers ports & direction control mtsr/p3.9 mrst/p3.8 slck/p3.13 p3 dp3 odp3 alternate functions sscbr ssctb sscrb data registers ssccon ssctic ssceic sscric interrupt control
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 85 micronas figure 7-39 synchronous serial channel ssc0 block diagram the operating mode of the serial channel ssc0 is controlled by its bit-addressable control register sscc0n. this register serves two purposes:  during programming (ssc0 disabled by ssc0en = ? 0 ? ) it provides access to a set of control bits  during operation (ssc enabled by ssc0en = ? 1 ? ) it provides access to a set of status flags the shift register of the ssc0 is connected to both the transmit pin and the receive pin via the pin control logic (see block diagram in figure 7-39 ). transmission and reception of serial data is synchronized and takes place at the same time, e.g. the same number of transmitted bits is also received. transmit data is written into the transmit buffer ssctb. it is moved to the shift register as soon as this is empty. an ssc master (ssc0ms = ? 1 ? ) immediately begins transmitting, while an ssc slave (ssc0ms = ? 0 ? ) will wait for an active shift clock. when the transfer starts, the busy flag ssc0bsy is set and a transmit interrupt request line (ssctir) will be activated to indicate that ssctb may be reloaded again. when the programmed number of bits (2 ? 16) has been ueb11158 16-bit shift register mrstx internal bus receive buffer register ssc0rb transmit buffer register ssc0tb mtsrx pin control ssc control block ssc0con status control ssc0eir ssc0tir ssc0rir receive int. request transmit int. request error int. request control clock shift clock generator baud rate sclkx 33 mhz
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 86 micronas transferred, the contents of the shift register are moved to the receive buffer sscrb and a receive interrupt request line (sscrir) will be activated. if no further transfer is to take place (ssctb is empty), ssc0bsy will be cleared at the same time. software should not modify ssc0bsy, as this flag is hardware controlled. note: only one ssc (etc.) can be master at a given time. the transfer of serial data bits can be programmed in many respects:  the data width can be chosen from 2 bits to 16 bits  a transfer may start with the lsb or the msb  the shift clock may be idle low or idle high  the data bits may be shifted with the leading or trailing edge of the clock signal  the baud rate may be set from 254 baud up to 16.66 mbaud (@ 33.33 mhz module clock)  the shift clock can be generated (master) or received (slave) these features allow the adaptation of the ssc0 to a wide range of applications, where serial data transfer is required. the data width selection supports the transfer of frames of any data length, from 2-bit ? characters ? up to 16-bit ? characters ? . starting with the lsb (ssc0hb = ? 0 ? ) allows communication e.g. with an ssc device in synchronous mode (c166 family) or 8051 like serial interfaces. starting with the msb (ssc0hb = ? 1 ? ) allows operation compatible with the spi interface. regardless which data width is selected and whether the msb or the lsb is transmitted first, the transfer data is always right aligned in registers ssctb and sscrb, with the lsb of the transfer data in bit 0 of these registers. the data bits are rearranged for transfer by the internal shift register logic. the unselected bits of ssctb are ignored, the unselected bits of sscrb will not be valid and should be ignored by the receiver service routine. the clock control allows the transmit and receive behavior of the ssc0 to be adapted to a variety of serial interfaces. a specific clock edge (rising or falling) is used to shift out transmit data, while the other clock edge is used to latch in receive data. bit ssc0ph selects the leading edge or the trailing edge for each function. bit ssc0po selects the level of the clock line in the idle state. so for an idle-high clock the leading edge is a falling one, a 1-to-0 transition (see figure 7-40 ).
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 87 micronas figure 7-40 serial clock phase and polarity options 7.4.1 full-duplex operation the different devices are connected by three lines. the definition of these lines is always determined by the master: the line connected to the master ? s data output pin mtsr is the transmit line, the receive line is connected to its data input line mrst, and the clock line is connected to pin sclk. only the device selected for master operation generates and outputs the serial clock on pin sclk. all slaves receive this clock, so their pin sclk must be switched to input mode. the output of the master ? s shift register is connected to the external transmit line, which in turn is connected to the slaves ? shift register input. the output of the slaves ? shift register is connected to the external receive line in order to enable the master to receive the data shifted out of the slave. the external connections are hard-wired, the function and direction of these pins is determined by the master or slave operation of the individual device. note: the shift direction shown in the diagram applies to msb-first operation as well as to lsb-first operation. when initializing the devices in this configuration, one device must be selected for master operation while all other devices must be programmed for slave operation. initialization includes the operating mode of the device ? s ssc and also the function of the respective port lines. ued11159 ssc0 po ssc0 ph 00 0 1 1 0 11 pins mtsr0/mrst0 transmit data shift clock sclk shift data first bit latch data last bit
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 88 micronas figure 7-41 ssc0 full duplex configuration the data output pins mrst of all slave devices are connected together onto the one receive line in this configuration. during a transfer; each slave shifts out data from its shift register. there are two ways to avoid collisions on the receive line due to different slave data:  only one slave drives the line , e.g. enables the driver of its mrst pin. all the other slaves have to program their mrst pins to input. so only one slave can put its data onto the master ? s receive line. only receiving of data from the master is possible. the master selects the slave device from which it expects data either by separate select lines, or by sending a special command to this slave. the selected slave then switches its mrst line to output, until it gets a deselection signal or command.  the slaves use open drain output on mrst . this forms a wired-and connection. the receive line needs an external pullup in this case. corruption of the data on the receive line sent by the selected slave is avoided, when all slaves which are not selected for transmission to the master only send ones ( ? 1 ? ). since this high level is not actively driven onto the line, but only held through the pullup device, the selected slave can actively pull this line to a low level when transmitting a zero bit. the master selects transmit mtsr mrst clk clock shift register device #1 master mtsr mrst clk receive clock shift register clock device #2 slave clk mrst device #3 mtsr clock shift register slave ued11160
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 89 micronas the slave device from which it expects data either by separate select lines, or by sending a special command to this slave. after performing all necessary initializations of the ssc0, the serial interfaces can be enabled. in a master device, the alternate clock line will now go to its programmed polarity. the alternate data line will go to either ? 0 ? or ? 1 ? , until the first transfer starts. after a transfer, the alternate data line will always remain at the logic level of the last transmitted data bit. when the serial interfaces are enabled, the master device can initiate the first data transfer by writing the transmit data into register ssctb. this value is copied into the shift register (which is assumed to be empty at this time), and the selected first bit of the transmit data will be placed onto the mtsr line on the next clock to the baud rate generator (transmission only starts, if ssc0en = ? 1 ? ). depending on the selected clock phase, a clock pulse will also be generated on the sclk line. with the opposite clock edge the master simultaneously latches and shifts in the data detected at its input line mrst. this ? exchanges ? the transmit data with the receive data. since the clock line is connected to all slaves, their shift registers will be shifted synchronously with the master ? s shift register, shifting out the data contained in the registers, and shifting in the data detected at the input line. after the pre-programmed number of clock pulses (via the data width selection) the data transmitted by the master is contained in all slaves ? shift registers, while the master ? s shift register holds the data of the selected slave. in the master and all the slaves, the content of the shift register is copied into the receive buffer sscrb and the receive interrupt line ssc0rir is activated. a slave device will immediately output the selected first bit (msb or lsb of the transfer data) at pin mrst, when the content of the transmit buffer is copied into the slave ? s shift register. it will not wait for the next clock from the baud rate generator, as the master does. the reason for this is that, depending on the selected clock phase, the first clock edge generated by the master may be already used to clock in the first data bit. so the slave ? s first data bit must already be valid at this time. note: on the ssc0 a transmission and a reception always takes place at the same time, regardless whether valid data has been transmitted or received. the initialization of the sclk pin on the master requires some attention in order to avoid undesired clock transitions, which may disturb the other receivers. the state of the internal alternate output lines is ? 1 ? as long as the ssc is disabled. this alternate output signal is anded with the respective port line output latch. enabling the ssc with an idle- low clock (ssc0po = ? 0 ? ) will immediately drive the alternate data output and (via the and) the port pin sclk low. to avoid this, the following sequence should be used:  select the clock idle level (ssc0po = ? x ? )  load the port output latch with the desired clock idle level  switch the pin to output  enable the ssc0 (ssc0en = ? 1 ? )  if ssc0po = ? 0 ? : enable alternate data output
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 90 micronas the same mechanism as for selecting a slave for transmission (separate select lines or special commands) may also be used to move the role of the master to another device in the network. in this case the previous master and the future master (previous slave) will have to toggle their operating mode (ssc0ms) and the direction of their port pins. 7.4.2 half duplex operation in a half duplex configuration only one data line is necessary for both receiving and transmitting of data. the data exchange line is connected to both the mtsr and mrst pins in each device, the clock line is connected to the sclk pin. the master device controls the data transfer by generating the shift clock, while the slave devices receive it. due to the fact that all transmit and receive pins are connected to the one data exchange line, serial data may be moved between arbitrary stations. similar to full duplex mode there are two ways to avoid collisions on the data exchange line:  only the transmitting device may enable its transmit pin driver  the non-transmitting devices use open drain output and only send ones. since the data inputs and outputs are connected together, a transmitting device will clock in its own data at the input pin (mrst for a master device, mtsr for a slave). by these means any corruptions on the common data exchange line, where the received data is not equal to the transmitted data are detected.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 91 micronas figure 7-42 ssc half duplex configuration 7.4.3 continuous transfers when the transmit interrupt request flag is set, it indicates that the transmit buffer ssctb is empty and ready to be loaded with the next transmit data. if ssctb has been reloaded by the time the current transmission is finished, the data is immediately transferred to the shift register and the next transmission starts without any additional delay. on the data line there is no gap between the two successive frames. for example, two byte transfers would look the same as one word transfer. this feature can be used to interface with devices which can operate with or require more than 16 data bits per transfer. how long a total data frame length can be depends on the software. this option can also be used e.g. to interface to byte-wide and word-wide devices on the same serial bus. note: of course, this can only happen in multiples of the selected basic data width, since it would require disabling/enabling of the ssc0 to reprogram the basic data width on-the-fly. transmit mtsr mrst clk clock shift register device #1 master mtsr mrst clk clock shift register clock device #2 slave clk mrst device #3 mtsr clock shift register slave ued11161 common transmit/ receive line
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 92 micronas 7.4.4 port control the ssc0 uses three pins to communicate with the external world. pin sclk serves as the clock line, while pins mrst (master receive/slave transmit) and mtsr (master transmit/slave receive) serve as the serial data input/output lines. the operation of the ssc0 pins depends on the selected operating mode (master or slave). the direction of the port lines depends on the operating mode. the ssc0 will automatically use the correct alternate input or output line of the ports when switching modes. the direction of the port pins, however, must be programmed by the user. using the open drain output feature of the port lines helps to avoid bus contention problems and reduces the need for hardwired hand-shaking or slave select lines. in this case it is not always necessary to switch the direction of a port pin. 7.4.5 baud rate generation the serial channel ssc0 has its own dedicated 16-bit baud rate generator with 16-bit reload capability, allowing baud rate generation independent from the timers. in addition to figure 7-39 , figure 7-43 shows the baud rate generator of the ssc0 in more detail. figure 7-43 ssc0 baud rate generator the baud rate generator is clocked with the module clock 33.33 mhz. the timer is counting downwards. register sscbr is the dual-function baud rate generator/reload register. reading sscbr, while the ssc0 is enabled, returns the content of the timer. reading sscbr, while the ssc0 is disabled, returns the programmed reload value. in this mode the desired reload value can be written to sscbr. note: never write to sscbr, while the ssc0 is enabled. ues11162 16-bit reload register 16-bit counter f sclk 2 33 mhz sclkmax f in master mode _ < 33 mhz / 2 in slave mode sclkmax f 33 mhz / 4 < _
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 93 micronas the formulas below calculate either the resulting baud rate for a given reload value, or the required reload value for a given baud rate: represents the content of the reload register, taken as an unsigned 16-bit integer while baud rate ssc is equal to f sclk as shown in figure 7-43 . the maximum baud rate that can be achieved when using a module clock of 33.33 mhz is 16.6 mbaud in master mode (with = 0000 h ) and 8.33 mbaud in slave mode (with = 0001 h ) lists some possible baud rates together with the required reload values and the resulting bit times, assuming a module clock of 33.33 mhz. 7.4.6 error detection mechanisms the ssc0 is able to detect four different error conditions. receive error and phase error are detected in all modes, while transmit error and baud rate error only apply to slave mode. when an error is detected, the respective error flag is set and an error interrupt request will be generated by activating the ssceir line (see figure 7-44 ). the error interrupt handler may then check the error flags to determine the cause of the error interrupt. the error flags are not reset automatically but rather must be cleared by software after servicing. this allows some error conditions to be serviced via interrupt, while the others may be polled by software. note: the error interrupt handler must clear the associated (enabled) error-flag(s) to prevent repeated interrupt requests. ) - 1 baud rate ssc0 = 2 ? ( + 1) 33 mhz = ( 2 ? baud rate ssc0 33 mhz
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 94 micronas figure 7-44 ssc0 error interrupt control a receive error (master or slave mode) is detected, when a new data frame is completely received, but the previous data was not read out of the receive buffer register sscrb. this condition sets the error flag ssc0re and, when enabled via ssc0ren, the error interrupt request line ssceir. the old data in the receive buffer sscrb will be overwritten with the new value and is unretrievably lost. a phase error (master or slave mode) is detected, when the incoming data at pin mrst0 (master mode) or mtsr0 (slave mode), sampled with the same frequency as the module clock, changes between one cycle before and two cycles after the latching edge of the shift clock signal sclk. this condition sets the error flag ssc0pe and, when enabled via ssc0pen, the error interrupt request flag ssceir. a baud rate error (slave mode) is detected, when the incoming clock signal deviates from the programmed baud rate by more than 100%, e.g. it is either more than double or less than half the expected baud rate. this condition sets the error flag ssc0be and, when enabled via ssc0ben, the error interrupt request line ssceir. using this error detection capability requires that the slave ? s baud rate generator is programmed to the same baud rate as the master device. this feature detects false additional, or missing pulses on the clock line (within a certain frame). ues11163 ssc0ten & ssc0te transmit error ssc0ren ssc0re error receive & ssc0pe ssc0pen phase error & ssc0be ssc0ben baud rate error & 1 error interrupt ssceir bit in register ssccon _ <
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 95 micronas note: if this error condition occurs and bit ssc0ren = ? 1 ? , an automatic reset of the ssc0 will be performed in case of this error. this is done to re-initialize the ssc0, if too few or too many clock pulses have been detected. a transmit error (slave mode) is detected, when a transfer is initiated by the master (shift clock gets active), but the transmit buffer ssctb of the slave was not updated since the last transfer. this condition sets the error flag ssc0te and, when enabled via ssc0ten, the error interrupt request line ssc0eir. if a transfer starts while the transmit buffer is not updated, the slave will shift out the ? old ? contents of the shift register, which is normally the data received during the last transfer. this may lead to the corruption of the data on the transmit/receive line in half-duplex mode (open drain configuration), if this slave is not selected for transmission. this mode requires that slaves not selected for transmission only shift out ones, e.g. their transmit buffers must be loaded with ? ffff h ? prior to any transfer. note: a slave with push/pull output drivers, which is not selected for transmission, will normally have its output drivers switched. however, in order to avoid possible conflicts or misinterpretations, it is recommended to always load the slave's transmit buffer prior to any transfer. the cause of an error interrupt request (receive, phase, baud rate, transmit error) can be identified by the error status flags in control register ssccon. note: in contrary to the error interrupt request line ssceir, the error status flags ssc0te, ssc0re, ssc0pe, and ssc0be, which are located in register ssccon, are not reset automatically upon entry into the error interrupt service routine, but must be cleared by software.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 96 micronas 7.4.7 register description the operating mode of the serial channel ssc0 is controlled by its control register ssccon. this register contains control bits for mode and error check selection, and status flags for error identification. depending on bit ssc0en, either control functions or status flags and master/slave control is enabled. ssc0en = 0: programming mode ssccon reset value: 0000 h bit function ssc0bm ssc0 data width selection 0: reserved. do not use this combination. 1 ? 15: transfer data width is 2 ? 16 bit (+1) ssc0hb ssc0 heading control bit 0: transmit/receive lsb first 1: transmit/receive msb first ssc0ph ssc0 clock phase control bit 0: shift transmit data on the leading clock edge, latch on trailing edge 1: latch receive data on leading clock edge, shift on trailing edge ssc0po ssc0 clock polarity control bit 0: idle clock line is low, leading clock edge is low-to-high transition 1: idle clock line is high, leading clock edge is high-to-low transition ssc0lb ssc0 loop back bit 0: normal output 1: receive input is connected with transmit output (half duplex mode) ssc0ten ssc0 transmit error enable bit 0: ignore transmit errors 1: check transmit errors ssc0ren ssc0 receive error enable bit 0: ignore receive errors 1: check receive errors 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw rw rw rw rw rw rw ssc0 en ssc0 ms - ssc0 aren ssc0 ben ssc0 pen ssc0 ren ssc0 ten ssc0 lb ssc0 po ssc0 ph ssc0 hb ssc0bm
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 97 micronas ssc0pen ssc0 phase error enable bit 0: ignore phase errors 1: check phase errors ssc0ben ssc0 baud rate error enable bit 0: ignore baud rate errors 1: check baud rate errors ssc0aren ssc0 automatic reset enable bit 0: no additional action upon a baud rate error 1: the ssc is automatically reset upon a baud rate error ssc0ms ssc0 master select bit 0: slave mode. operate on shift clock received via sclk. 1: master mode. generate shift clock and output it via sclk. ssc0en ssc0 enable bit = ? 0 ? transmission and reception disabled. access to control bits. bit function
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 98 micronas ssc0en = 1: operating mode ssccon reset value: 0000 h note: the target of an access to ssccon (control bits or flags) is determined by the state of ssc0en prior to the access, i.e. writing c057 h to ssc0con in programming mode (ssc0en = ? 0 ? ) will initialize the ssc (ssc0en was ? 0 ? ) and then switch it on (ssc0en = ? 1 ? ). when writing to ssccon, make sure that zeros are input to reserved locations. the ssc0 baud rate timer reload register sscbr contains the 16-bit reload value for the baud rate timer. bit function ssc0bc ssc0 bit count field shift counter is updated with every shifted bit. do not write to!!! ssc0te ssc0 transmit error flag 1: transfer starts with the slave ? s transmit buffer not being updated ssc0re ssc0 receive error flag 1: reception completed before the receive buffer was read ssc0pe ssc0 phase error flag 1: received data changes around sampling clock edge ssc0be ssc0 baud rate error flag 1: more than factor 2 or 0.5 between slave ? s actual and expected baud rate ssc0bsy ssc0 busy flag set while a transfer is in progress. do not write to!!! ssc0ms ssc0 master select bit 0: slave mode. operate on shift clock received via sclk. 1: master mode. generate shift clock and output it via sclk. ssc0en ssc0 enable bit = ? 1 ? transmission and reception enabled. access to status flags and m/s control. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw r rw rw rw rw rw ssc0 en ssc0 ms - ssc0 bsy ssc0 be ssc0 pe ssc0 re ssc0 te - - - - ssc0bc
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 99 micronas sscbr reset value: 0000 h the ssc0 transmitter buffer register ssctb contains the transmit data value. ssctb reset value: 0000 h the ssc0 receiver buffer register sscrb contains the receive data value. bit function ssc0rl (15 ? 0) baud rate timer/reload register value reading sscbr returns the 16-bit content of the baud rate timer. writing ssc0br loads the baud rate timer reload register. bit function ssc0td (15 ? 0) transmit data register value ssctb contains the data to be transmitted. unselected bits of ssc0tb are ignored during transmission. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw ssc0rl(15 ..0) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw ssc0td(15..0)
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 100 micronas sscrb reset value: 0000 h bit function ssc0rd (7 ? 0) receive data register value sscrb contains the received data bits. unselected bits of ssc0rb will be not valid and should be ignored 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r ssc0rd(15..0)
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 101 micronas 7.5 i 2 c-bus interface the on-chip i 2 c bus module connects the m2 to other external controllers and/or peripherals via the two-line serial i 2 c interface. the i 2 c bus module provides communication at data rates of up to 400 kbit/s and features 7-bit as well as 10-bit addressing. the module can operate in three different modes: master mode , where the i 2 c controls the bus transactions and provides the clock signal. slave mode , where an external master controls the bus transactions and provides the clock signal. multimaster mode , where several masters can be connected to the bus, i.e. the i 2 c can be master or slave. the on-chip i 2 c bus module allows efficient communication via the common i 2 c bus. the module unloads the cpu of low level tasks such as  (de)serialization of bus data.  generation of start and stop conditions.  monitoring the bus lines in slave mode.  evaluation of the device address in slave mode.  bus access arbitration in multimaster mode. features  extended buffer allows up to 4 send/receive data bytes to be stored.  support of standard 100 kbaud and extended 400 kbaud data rates.  operation in 7-bit or 10-bit addressing mode.  flexible control via interrupt service routines or by polling. 7.5.1 operational overview data is transferred by the 2-line i 2 c bus (sda, scl) using a protocol that ensures reliable and efficient transfers. this protocol clearly distinguishes regular data transfers from defined control signals which control the data transfers. the following bus conditions are defined: bus idle : sda and scl remain high. the i 2 c bus is currently not used. data valid : sda stable during the high phase of scl. sda then represents the transferred bit. there is one clock pulse for each transferred bit of data. during data transfers sda may only change while scl is low (see below)! start transfer : a falling edge on sda ( ) while scl is high indicates a start condition. this start condition initiates a data transfer over the i 2 c bus.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 102 micronas stop transfer : a rising edge on sda ( ) while scl is high indicates a stop condition. this stop condition terminates a data transfer. an arbitrary number of bytes may be transferred between a start condition and a stop condition. 7.5.2 the physical i 2 c-bus interface communication via the i 2 c bus uses two bidirectional lines, the serial data line sda and the serial clock line scl. each of these two generic interface lines can be connected to a number of io port lines. these connections can be established and released under software control. figure 7-45 i 2 c bus line connections ues11164 sdax sda0 scl0 sclx c module 2 generic data line generic clock line
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 103 micronas this mechanism allows a number of configurations of the physical i 2 c bus interface: physical channels can be selected, so the i 2 c module can use electrically separated channels or increase the addressing range by using more data lines. note: baud rate and physical channels should never be changed (via iccfg) during a transfer. channel switching the i 2 c module can be connected to a specific pair of pins (e.g. sda0 and scl0) which then forms a separate i 2 c channel to the external system. the channel can be dynamically switched by connecting the module to another pair of pins (e.g. sda1 and scl1). this establishes physically separate interface channels. broadcasting: connecting the module to more than one pair of pins (e.g. sda0/1 and scl0/1) allows the transmission of messages over multiple physical channels at the same time. please note that this configuration is critical when the m2 is a slave. in master mode it cannot be guaranteed that all selected slaves have reached the message. register iccfg selects the bus baud rate as well the activation of sda and scl lines. so an external i 2 c channel can be established (baud rate and physical lines) with one single register access. note: respective port pin definition
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 104 micronas figure 7-46 physical bus configuration example output pin configuration the pin drivers that are assigned to the i 2 c channel(s) provide open drain outputs (i.e. no upper transistor). this ensures that the i 2 c module does not put any load on the i 2 c bus lines while the m2 is not powered. the i 2 c bus lines therefore require external pull- up resistors (approx. 10 k for operation at 100 kbaud, 2 k for operation at 400 kbaud). all pins of the m2 that are to be used for i 2 c bus communication must be switched to output, opendrain and their alternate function must be enabled (by setting the respective port output latch to ? 1 ? ), before any communication can be established. if not driven by the i 2 c module (i.e. the corresponding enable bit in register iccfg is ? 0 ? ) they then switch off their drivers (i.e. driving ? 1 ? to an open drain output). due to the external pull-up devices the respective bus levels will then be ? 1 ? which is idle. the i 2 c module features digital input filters in order to improve the noise output from the external bus lines. ues11165 sda 6000 scl sda c-bus node 2 c-bus node 2 c-channel 0 2 sda scl c-channel 1 2
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 105 micronas 7.5.3 functional overview operation in master mode if the on-chip i 2 c module controls the i 2 c bus (i.e. bus master), master mode must be selected via bit field mod in register iccon. the physical channel is configured by a control word written to register iccfg, defining the active interface pins and the used baud rate. more than one sda and/or scl line may be active at a time. the address of the remote slave that is to be accessed is written to icrtb0 ? 3. the bus is claimed by setting bit bum in register iccon. this generates a start condition on the bus and automatically starts the transmission of the address in icrtb0. bit trx in register iccon defines the transfer direction (trx = ? 1 ? , i.e. transmit, for the slave address). a repeated start condition is generated by setting bit rsc in register iccon, which automatically starts the transmission of the address previously written to icrtb0. this may be used to change the transfer direction. rsc is cleared automatically after the repeated start condition has been generated. the bus is released by clearing bit bum in register iccon. this generates a stop condition on the bus. note: between load the address in icrtb0 an setting bit bum at least one command (nop) has to be executed. operation in multimaster mode if multimaster mode is selected via bit field mod in register iccon, the on-chip i 2 c module can operate concurrently as a bus master or as a slave. the descriptions of these modes apply accordingly. multimaster mode implies that several masters are connected to the same bus. as more than one master may try to claim the bus at a given time, an arbitration is done on the sda line. when a master device detects a mismatch between the data bit to be sent and the actual level on the sda (bus) line, it looses the arbitration and automatically switches to slave mode (leaving the other device as the remaining master). this loss of arbitration is indicated by bit al in register icst which must be checked by the driver software when operating in multimaster mode. lost arbitration is also indicated when the software tries to claim the bus (by setting bit bum) while the i 2 c bus is active (indicated by bit bb = ? 1 ? ). bit al must be cleared via software. operation in slave mode if the on-chip i 2 c module is controlled via the i 2 c bus by a remote master (i.e. be a bus slave), slave mode must be selected via bit field mod in register iccon. the physical channel is configured by a control word written to register iccfg, defining the active interface pins and the used baud rate. it is recommended to have only one sda and scl
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 106 micronas line active at a time when operating in slave mode. the address by which the slave module can be selected is written to register icadr. the i 2 c module is selected by another master when it receives (after a start condition), either its own device address (stored in icadr) or the general call address (00 h ). in this case an interrupt is generated and bit sla in register icst is set, indicating the valid selection. the desired transfer mode is then selected via bit trx (trx = ? 0 ? for reception, trx = ? 1 ? for transmission). for a transmission the respective data byte is placed into the buffer icrtb0 ? 3 (which automatically sets bit trx) and the acknowledge behavior is selected via bit ackdis. for a reception the respective data byte is fetched from the buffer icrtb0 ? 3 after irqd has been activated. in both cases the data transfer itself is enabled by clearing bits irqd, irqp and irqe which releases the scl line. when a stop condition is detected, bit sla is cleared. the i 2 c bus configuration register iccfg selects the bus baud rate (partly) as well as the activation of sda and scl lines. so an external i 2 c channel can be established (baud rate and physical lines) with one single register access. systems that utilize several i 2 c channels can prepare a set of control words which configure the respective channels. by writing one of these control words to iccfg the respective channel is selected. different channels may use different baud rates. also different operating modes can be selected, e.g. enabling all physical interfaces for a broadcast transmission. note: refer also to chapter 7.5.2 .
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 107 micronas 7.5.4 registers all available module registers are summarized in the overview table below. i 2 c configuration register iccfg reset value: 0000 h register name register description address b/p 1) 1) b : b it addressable / p : bit p rotected reset value iccfg i 2 c configuration register 00 ? e810 h b0000 h iccon i 2 c control register 00 ? e812 h b0000 h icst i 2 c status register 00 ? e814 h b0000 h icadr i 2 c address register 00 ? e816 h b0000 h icrtbl i 2 c receive/transmit buffer 00 ? e818 h ? 0000 h icrtbh i 2 c receive/transmit buffer 00 ? e81a h ? 0000 h iicpisel 2) 2) itus currently no function. should be left on reset value. i 2 c port input select register 00 ? e804 h b0000 h 1514131211109876543210 brpl 0 0 scl en1 scl en0 0 sda en2 sda en1 sda en0 field bits type value description sdaenx (x = 2 ? 0) 2 ? 0rw 0 1 enable input for data pin x these bits determine to which pins the i 2 c data line is connected. sda pin x is disconnected. sda pin x is connected with i 2 c data line. sclenx (x = 3 ? 0) 5 ? 4rw 0 1 enable input for clock pin x these bits determine to which pins the i 2 c clock line is connected. scl pin x is disconnected. scl pin x is connected with i 2 c clock line. brpl 15 ? 8rw ? baud rate prescaler low determines the 8 least significant bits of the 10 bit baud rate prescaler. (see bprh in icadr.)
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 108 micronas i 2 c control register iccon reset value: 0000 h 1514131211109876543210 wm en 000 ci stpigetrxint ack dis bu m mod rsc m10 field bits type value description m10 0 rw 0 1 address mode 7-bit addressing using ica7 ? 1. 10-bit addressing using ica9 ? 0. rsc 1 rwh 0 1 repeated start condition no operation. generate a repeated start condition in (multi) master mode. rsc cannot be set in slave mode. note: rsc is cleared automatically after the repeated start condition has been sent. mod [3:2] rwh 00 01 10 11 basic operating mode i 2 c module is disabled and initialized (init- mode). transmissions under execution will be aborted. slave mode. 10 master mode. 11 multi-master mode. bum 4 rwh 0 1 busy master clearing bit bum ( ) generates a stop condition immediately. setting bit bum ( ) generates a start condition in (multi)master mode. note: setting bit bum ( ) while bb = ? 1 ? generates an arbitration lost situation. in this case bum is cleared and bit al is set. bum can not be set in slave mode.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 109 micronas ackdis 5 rwh 0 1 acknowledge pulse disable an acknowledge pulse is generated for each received frame. no acknowledge pulse is generated. note: ackdis is automatically cleared by a stop condition. int 6 rw 0 1 interrupt delete select interrupt flag irqd is deleted by read/write to icrtb0 ? 3. interrupt flag irqd is not deleted by read/ write to icrtb0 ? 3. trx 7 rwh 0 1 transmit select no data is transmitted to the i 2 c bus. data is transmitted to the i 2 c bus. note: trx is set automatically when writing to the transmit buffer. it is not allowed to delete this bit in the same buscycle. it is automatically cleared after last byte as slave transmitter. ige 8 rw 0 1 ignore irqe ignore irqe (end of transmission) interrupt. the i 2 c is stopped at irqe interrupt. the i 2 c ignores the irqe interrupt. if rmen is set, rm is mirrored here. stp 9 rwh 0 1 stop master 0 clearing bit stp generates no stop condition. 1 setting bit stp generates a stop condition after next transmission. bum is set to zero. ackdis is set to one. stp is automatically cleared by a stop condition. if rmen is set, rm is mirrored here. field bits type value description
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 110 micronas ci [10:9] rw 00 01 10 11 length of the transmit buffer 1 byte 2 bytes 3 bytes 4 bytes if rmen is set, rm is mirrored here. wmen 15 rwh 0 1 write mirror enable write mirror is not active write mirror is active if rmen is set wmen can not be set and will remain zero. if wmen and rmen are simultaneously set to 1, both will remain what they are. so only one of each can be set to 1. rm [15:8] rw ? read mirror if rmen is set, rtb0 may be read here. writing to rm has no effect in this mode. field bits type value description
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 111 micronas i 2 c status register icst reset value: 0000 h 1514131211109876543210 rm en 0000 co irq e irq p irq d bb lrb sla al adr field bits type value description adr 0 rh ? address bit adr is set after a start condition in slave mode until the address has been received (1 byte in 7-bit address mode, 2 bytes in 10- bit address mode). al 1 rwh ? arbitration lost bit al is set when the i 2 c module has tried to become master on the bus, but has lost the arbitration. operation is continued until the 9th clock pulse. if multimaster mode is selected the i 2 c module temporarily switches to slave mode after a lost arbitration. bit irqp is set along with bit al. al must be cleared via software. sla 2 rh 0 1 slave the i 2 c module is not selected as a slave, or the module is in master mode. the i 2 c module has been selected as a slave (device address received). lrb 3 rh ? last received bit bit lrb represents the last bit (i.e. the acknowledge bit) of the last transferred frame. it is automatically set to zero by a write or read access to the buffer icrtb0 ? 3. note : if lrb is high (no acknowledge) in slave mode, trx bit is set automatically.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 112 micronas bb 4 rh 0 1 bus busy the i 2 c bus is idle, i.e. a stop condition has occurred. the i 2 c bus is active, i.e. a start condition has occurred. note: bit bb is always ? 0 ? while the i 2 c module is disabled. irqd 5 rwh 0 1 i 2 c interrupt request bit for data transfer events 1) no interrupt request pending. a data transfer event interrupt request is pending. irqd is set after the acknowledge bit of the last byte has been received or transmitted, and is cleared automatically upon a complete read or write access to the buffer(s) icrtb0 ? 3. new data transfers will start immediately after clearing irqd. do not access any register until next interrupt. if in polling mode and ci is ? 0 ? only 8-bit accesses to the lower byte are allowed. note: if a multi byte write could not be finished in slave mode because of missing acknowledge, then the data interrupt is followed by a end of transmission interrupt. the number of bytes sent can be read from co. the data interrupt must have higher priority than irqe. field bits type value description
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 113 micronas irqp 6 rwh 0 1 i 2 c interrupt request bit for protocol events 1) no interrupt request pending. a protocol event interrupt request is pending. irqp is set when bit sla or bit al is set ( ), and must be cleared via software. if the i 2 c has been selected by an other master, the software must look up the required transmission direction by reading the received address and direction bit, stored in icrtb0. the trx-bit must correspondingly be set by software. irqe 7 rwh 0 1 i 2 c interrupt request bit for data transmission end 1) no interrupt request pending. a receive end event interrupt request is pending (a stop is detected). irqe is automatically cleared upon a start condition. irqe is not activated in init- mode. irqe must always be deleted to continue transmission. note: in slave mode irqe is set after the transmission is finished. this can also be after a stop or rsc condition. in this case the slave is not selected any more. this bit is also set, if a transmission is stopped by a missing acknowledge. in this case the bit must be cleared by software. field bits type value description
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 114 micronas 1) while irqd, irqp or irqe is set and the i 2 c module is in master mode or has been selected as a slave, the i 2 c clock line is held low which prevents further transfers on the i 2 c bus. the clock line of the i 2 c bus is released when irqd, irqe and irqp are cleared. only in this case can the next i 2 c bus action take place. interrupt request bits may be set or cleared via software, e.g. to control the i 2 c bus. co 10..8 rw 000 001 010 011 100 counter of transmitted bytes since last data interrupt. if a multi byte transmission could not be finished because of a missing acknowledge, the number of correctly transferred bytes can be read from co. it is automatically set to zero by the correct number (defined by ci) of write/read accesses to the buffers icrtb0 ? 3. no byte 1 byte 2 bytes 3 bytes 4 bytes the number of legal bytes depends on the data buffer size (ci). writing to this bit field does not affect its content. if wmen is set, wm is mirrored here. wm [15:8] wh ? write mirror if wmen is set, rtb0 may be written here. reading wm will result in zero. field bits type value description
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 115 micronas i 2 c address register icadr reset value: 0000 h baud rate selection in order to give the user high flexibility in selection of cpu frequency and baud rate, without constraints to baud rate accuracy, a flexible baud rate generator has been 1514131211109876543210 brp mo d prediv 0 0 0 ica 9/ 0 ica 8 ige ica7..1 ica 0/ 0 field bits type value description ica0 0 rw ? node address bit 0 in 10-bit mode (see iccon bit m10) access is only possible in 10-bit mode. ? 0 0 0 reserved read/write 0 if in 7-bit mode. ica7 ? 17..1rw ? node address in 7-bit mode (ica9 and ica0 disregarded, ica8 becomes ige-bit). ige 8 rw 0 1 ignore irqe in 7-bit mode, this bit becomes ige-bit: ignore irqe (end of transmission) interrupt. the i 2 c is stopped at irqe interrupt. the i 2 c ignores the irqe interrupt. access is only possible in 7-bit mode. ica8 8 rw ? node address bit 8 in 10-bit mode access is only possible in 10-bit mode. ica9..0 9..0 rw ? node address in 10-bit mode (all bits used). note: access is only possible in 10-bit mode. prediv [14:13] rw 00 01 10 11 pre divider for baud rate generation pre divider is disabled pre divider factor 8 is enabled pre divider factor 64 is enabled reserved, do not use brpmod 15 rw 0 1 baud rate prescaler mode mode 0 is enabled (by default) mode 1 is enabled.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 116 micronas implemented. it uses two different modes and an additional pre divider. low baud rates may be configured at high precision in mode 0 which is compatible with older versions. high baud rates may be configured precisely in mode 1. mode 0: reciprocal divider the resulting baud rate is mode 1: fractional divider the resulting baud rate is table 7-24 i 2 c-bus baud rate selection @ 33.33 mhz cpu-freq. brpmod brp @ 100 kbaud brp @ 400 kbaud prediv =00 b prediv =01 b prediv =10 b prediv =00 b prediv =01 b prediv =10 b 052 h 0a h 1 h 14 h 02 h ? 103 h ?? 0c h 02 h ? b iic f cpu 4brp1 + ? ----------------------------------- = brp f cpu 4b iic ------------------ 1 ? = b iic f cpu brp 1024 --------------------------- = brp 1024 b iic f cpu ---------------------------- =
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 117 micronas i 2 c receive/transmit buffer icrtbh/l reset value: 0000 h 1) a read respectively a write access (depending on bit trx) to all bytes (specified in ci) of icrtb0 ? 3 sets co to 111 (no byte sent/received). 2) if bit int is set to zero and all bytes (specified in ci) of icrtb0 ? 3 are read/written (depending on bit trx) irqd is cleared. 1514131211109876543210 icrtb3 icrtb2 1514131211109876543210 icrtb1 icrtb0 field bits type value description icrtbx x= 3 ? 0 15..0 rwh ? receive/transmit buffer 1) 2) the buffers contain the data to be sent/ received. the buffer size can be set in bit field ci (from 1 up to 4 bytes). icrtb0 is sent/ received first.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 118 micronas interrupts table 7-25 interrupt sources interrupt src register description data i 2 ctic interrupt is requested after the acknowledge bit of the last byte has been received or transmitted. data error i 2 ctic interrupt is requested if a multi byte write could not be finished in slave mode because of missing acknowledge, then the data interrupt is followed by an end of transmission interrupt. protocol: arbitration lost i 2 cpic interrupt is requested when the i 2 c module has tried to become master on the bus but has lost the arbitration. protocol: slave mode after lost arbitration i 2 cpic interrupt is requested if multimaster mode is selected and the i 2 c module temporarily switches to slave mode after a lost arbitration. protocol: slave mode after device address i 2 cpic interrupt is requested if multimaster mode is selected and the i 2 c module temporarily switches to slave mode after a lost arbitration. data trans-mission end after stop condition i 2 cteic interrupt is requested after transmission is finished by a stop condition. data trans-mission end after rsc condition i 2 cteic interrupt is requested after transmission is finished by a repeated start condition (rsc). data transmission end after missing acknowledge i 2 cteic interrupt is also requested if a transmission is stopped by a missing acknowledge.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 119 micronas synchronization in mastermode, the scl line is controlled by the i 2 c module. sent and received data is only valid if scl is high. with scl going down, all modules are starting to count down their low period. during the low period all connected modules are allowed to hold scl low. as the physical bus connection is wired-and, scl will remain low until the device with the longest low period enters high state. then the device with the shortest high period will pull scl low again. programming it is strictly recommended not to write to the i 2 c registers when the i 2 c is working, except for interrupt handling. this is indicated by the bum bit (in master mode) and the interrupt flags. all registers can be written in initial mode. in master mode the i 2 c is working as long as the bum bit is set, in slave mode the i 2 c is working from receiving a start condition until receiving the next stop condition. change of transmit direction is possible only after a protocol interrupt (irqp) or in initialization mode (mod = 00 b ). initialization before data can be sent or received, data buffer size must be set in the count registers (only necessary if buffer greater than one byte is available). to decide if slave/master or multimaster mode is required, the mod bits must be programmed. repeated start condition the rsc bit must be set to one. start condition to generate a start condition the i 2 c must be in master mode. if the bum bit is set, a start condition is sent and the transmission started. the slave returns the acknowledge bit, which is indicated by the lrb bit. sending data bytes to send bytes it is only necessary to write data bytes to the transmit buffer every time a data interrupt (irqd) occurs. stop condition the bum bit must be set to zero, or the stp bit must be set to one. receiving data bytes to receive bytes it is necessary to set the trx bit to zero. the bytes can be read after every data interrupt (irqd). after a stop condition (protocol interrupt irqe), the count
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 120 micronas bit field co must be read in case the buffer size (defined in ci) is greater than one byte, to decide which bytes in the receive buffer were received in the last transmission cycle.
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 121 micronas 7.6 analog digital converter m2 includes a four channel 8-bit adc for control purposes. by means of these four input signals the controller is able to supervise the status of several analog signals and to take action if necessary. as these analog signals are fairly slow (compared to the video input), one sar-converter is used. the input is multiplexed to four different analog inputs. the adc is running continuously. the four channels are scanned one after another. the conversion results (one byte per channel), for the four channels, are stored in registers addat1 and addat2. after completion of the conversion for the last channel, two interrupt request flags adc1ir and adc2ir are generated. the peripheral event controller (pec) may be used to automatically store the conversion results into a table in the memory for later evaluation, without requiring the overhead of entering and exiting interrupt routines for each data transfer. the s&h circuit is open for about 2 s. new results are available in addat1 and addat2 every 48 s. the previous conversion results are overwritten unless the contents are transferred to the memory by pec data transfers or an ordinary interrupt service routine. if some of the port lines p5.0 to p5.3 are to be used as digital inputs the associated enable bits in register p5ben have to be enabled. the input voltage on port 5 should never exceed 2.5 v. a set of sfrs and port pins provide access to control functions and results of the adc. figure 7-47 sfrs and port pins associated with the a/d converter 7.6.1 power down and wake up as the power consumption of the adc is quite high it should also be switched off during idle mode. due to some application requirements it is necessary to include the possibility a/d converter interrupt control register a/d converter interupt control register a/d converter result register 2 a/d converter result register 1 port 5 data register addat2 addat1 p5 ad1ic ad2ic (end of conversion) (end of conversion) uea11166 interrupt control data registers addat1 addat2 ports & direction control alternate functions an0/p5.0 ... an3/p5.3 p5 control registers adcon ad2ic ad1ic
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 122 micronas of generating an interrupt signal (adwic) as soon as the cadc (ana0) input voltage falls below a predefined level. two different levels are available. the first one corresponds to (fullscale-4 lsb) the second one to (fullscale-16 lsb). the actual level can be selected by a control bit (adwule). 7.6.2 register description adcon reset value: 0000 h addat1 reset value: 0000 h bit function fsadcdiff selects fsadc input range selects input range of the full service adc: fsadcdiff = 0: single-ended input fsdacdiff = 1: differential input adwule defines threshold level for wake up a special wake up unit has been implemented to allow a system wake- up as soon as the analog input signal on pin ana0 falls below a predefined level. adwule defines this level. adwule = 0: threshold level corresponds to fullscale-4lsb. adwule = 1: threshold level corresponds to fullscale-16lsb. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw - - - - - - - - - - fs adc diff ad- wul e - - - - rw 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw adres1 adres0
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 123 micronas addat2 reset value: 0000 h bit function adres i (7 ? 0) a/d conversion result (8-bit) of channel 0 ? 3 (ana 0 ? 3) for each a/d channel two successive 7-bit samples (@33.3 mhz) are processed, averaged and scaled to 0 - 254. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw adres3 adres2
sda 6000 preliminary data sheet version 2.1 peripherals 7 - 124 micronas
clock system
sda 6000 preliminary data sheet version 2.1 clock system 8 - 3 micronas 8 clock system
sda 6000 preliminary data sheet version 2.1 clock system 8 - 4 micronas 8.1 general function the on-chip clock generator provides m2 with its basic clock signals. its oscillator can either run with an external crystal and appropriate oscillator circuitry (refer to ? application diagram ? ) or it can be driven by an external digital clock signal. for applications with low accuracy requirements (rtc is not used) the external oscillator circuit can also be a ceramic resonator. depending on the absolute tolerance of the resonator the slicer may not work correctly. moreover the display timings and baud rate prescaler have to be adapted in an appropriate way. in some applications the timing reference given by the horizontal frequency of the cvbs signal can be used to measure the timing tolerance and to adjust the programming. figure 8-1 clock system in m2 the on-chip phase locked loop (pll), which is internally running at 600 mhz, is fed by the oscillator or can be bypassed to reduce the power consumption in idle and sleep mode. if it is not required to wake up immediately from idle mode, the pll can be switched off by entering sleep-mode. the same oscillator is used to clock the built-in rtc. (for a further description refer to chapter 7.2 .) from the output frequency of the pll three clock systems are derived: 3 mhz 300 mhz dto sru (part 2) display-fifo 50 mhz pix 10 mhz f ues11167 dac 6 mhz xtal2 xtal1 osc 2 pll 200 mhz (3) 2 6 f cpu c-periph. sync ports slicer adc dg ebi cluts 100 mhz emi 66.7 mhz f 3 mhz 33.33 mhz c rtc
sda 6000 preliminary data sheet version 2.1 clock system 8 - 5 micronas one, the 33 mhz system clock ( f cpu ) supplies the processor, all processor related peripherals, the sync timing logic, the a/d converters and the slicer. the second clock system (100/66 mhz) ( f ebi ) is used to clock the external bus interface, the display generator, the cluts and the input part of the display fifo. this clock starts at 66 mhz after hardware reset. it can be configured to 100 mhz during the initialization sequence. the frequency of the latter clock system can be changed via bit clkcon in register syscon2. the refresh rate of the external sdram is always kept constant, independent of the selected system clock frequency. the third clock system runs the pixel clock ( f pix ), which is programmable in a range of 10 ? 50 mhz. it serves the output part of the display fifo and the d/a converters. the pixel clock is derived from the high frequency output of the pll and it is phase shifted line by line to the positive edge of the horizontal sync signal (normal polarity). because the final display clock is derived from a dto (digital time oscillator) it has no equidistant clock periods although the average frequency is exact. this pixel clock generation system has several advantages:  the frequency of the pixel clock can be programmed independently from the horizontal line period.  since the input of the pll is already a signal with a high frequency, the resulting pixel frequency has an extremely low jitter.  the resulting pixel clock follows the edge of the h-sync impulse without any delay and always has the same quality as the sync timing of the deflection controller.
sda 6000 preliminary data sheet version 2.1 clock system 8 - 6 micronas 8.2 register description syscon2 reset value: 0000 h note: register syscon2 cannot be changed after execution of the einit instruction. pfr reset value: 0148 h bit function clkcon bus clock frequency 0: f ebi = 66 mhz 1: f ebi = 100 mhz bit function pf (10 ? 0) pixel frequency factor this register defines the relation between the output pixel frequency and the frequency of the crystal. the pixel frequency does not depend on the line frequency. it can be calculated by the following formula: the pixel frequency can be adjusted in steps of 36.6 khz. after power-on, this register is set to 328 d . so, the default pixel frequency is set to 12.01 mhz. note: register values exceeding 1366 generate pixel frequencies which are outside of the specified boundaries. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw 1 - - - - - clk con - - - - - - - - - r 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw - - - - - - pf(10..0) f pix = pf ? 300 mhz / 8192
sda 6000 preliminary data sheet version 2.1 clock system 8 - 8 micronas
sync system
sda 6000 preliminary data sheet version 2.1 sync system 9 - 3 micronas 9 sync system
sda 6000 preliminary data sheet version 2.1 sync system 9 - 4 micronas 9.1 general description the display sync system is completely independent of the acquisition sync system (cvbs timing) and can either work as a sync master or as a sync slave system. any mention of ? h/v-syncs ? in this chapter and in chapter 10 always refers to display related h/v syncs and never to cvbs related sync timing. in sync slave mode, m2 receives the synchronisation information from two independent pins which deliver separate horizontal and vertical signals. due to the not-line-locked pixel clock generation (refer to chapter 8 ), it can process any possible horizontal and vertical sync frequency. in sync master mode, m2 delivers separate horizontal and vertical signals with the same flexibility in the programming of their periods as in sync slave mode. 9.1.1 screen resolution the number of displayable pixels on the screen is defined by the pixel frequency (which is independent of horizontal frequency), the line period and number of lines within a field. the screen is divided into 3 different regions:
sda 6000 preliminary data sheet version 2.1 sync system 9 - 5 micronas figure 9-1 m2 ? s display timing blacklevel clamping area during horizontal and vertical blacklevel clamping, the black value (rgb = 000) is delivered. the blank pin is set to ? 1 ? and cor is set to ? 0 ? (normal polarity assumed). this area is vertically programmable (in terms of lines) and horizontally in terms of 33.33 mhz clock cycles. these programmings are independent of all other registers. screen background area the size of that area is defined by the sync delay registers (sdh and sdv) and the size of pixel layer1. the contents of that area are defined by ga instruction sar (refer also to chapter 10.1 ). pixels within that area are programmable (colour and transparency level), but all have the same value. layer 2 pixel (ehcr) h_clmp_e h-sync t (bhcr) h_clmp_b t h_period (hpr) t vlr evcr bvcr screen background area vertical blacklevel clamping (sdh) horizontal blacklevel clamping h-sync delay variable width pixel layer 1 uet11168 v-sync delay (sdv) variable height
sda 6000 preliminary data sheet version 2.1 sync system 9 - 6 micronas pixel layer area pixels of this area are freely programmable according to the specifications of the display generator. the information is stored in the frame buffer in the external memory, that means the bigger that area is defined, the more bus performance is needed for sru. if that area is set to ? 0 ? no bus performance is needed. the start position of that area can be shifted in horizontal and vertical direction by programming the horizontal and vertical sync delay registers (sdh and sdv). the size of that area is defined by the instruction fsr in the display generator. registers which allow the screen and sync parameters to be set up, are given in the table 9-1 . 9.1.2 sync interrupts the sync unit delivers interrupts (horizontal and vertical interrupt) to the controller to support the recognition of the frequencies of an external sync source (e.g. a vga source via scart). these interrupts are related to the positive edge of the non delayed horizontal and vertical impulses which can be seen at pins hsync and vsync. table 9-1 overview on sync register settings parameters register min value max value step default sync control register scr see below vl - lines / field vlr 1 line 1024 lines 1 line 625 lines t h-period - horizontal period hpr 15 s100 s 30 ns 64 s f pixel - pixel frequency pfr 10 mhz 50 mhz 73.25 khz 12.01 mhz t vsync_delay - sync delay sdv 4 lines 1024 lines 1 line 32 lines t hsync_delay - sync delay sdh 32 pixel 2048 pixel 1 pixel 72 pixel bvcr - beginning of vertical clamp phase bvcr 1 line 1024 lines 1 line line 1 evcr - end of of vertical clamp phase evcr 1 line 1024 lines 1 line line 5 t h_clmp_b - beginning of horizontal clamp phase bhcr 0 s163.2 s 480 ns 0 s t h_clmp_e - end of horizontal clamp phase ehcr 0 s163.2 s 480 ns 4.5 s
sda 6000 preliminary data sheet version 2.1 sync system 9 - 7 micronas 9.2 register description scr reset value: 0000 h bit function mast master / slave mode this bit defines the configuration of the sync system (master or slave mode) and also the direction (input/output) of the v, h pins. 0: slave mode. h, v pins are configured as inputs. 1: master mode. h, v pins are configured as outputs. note: switching from slave to master mode resets the internal h, v counters, so that the phase shift during the switch can be minimized. in slave mode registers vlr, and hpr are without any use. vcs vertical composite sync vcs defines the sync output at pin v ( master mode only ). 0: at pin v the vertical sync appears. 1: at pin v a composite sync signal (including equalizing pulses, h- sync and v-syncs) is generated (vcs). the length of the equalizing pulses have fixed values as described in the timing specifications. note: don ? t forget to set registers vlr and hpr according to your requirements. int interlace / non-interlace m2 can either generate an interlaced or a non-interlaced timing. (master mode only). interlaced timing can only be created if vlr is an odd number. 0: interlaced timing is generated. 1: non-interlaced timing is generated. vp v-pin polarity this bit defines the polarity of the v pin (master and slave mode). 0: normal polarity (active high). 1: negative polarity. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw rw rw rw - - - - cor- bl vsu(3..0) blan kp cor p hp vp int vcs mast
sda 6000 preliminary data sheet version 2.1 sync system 9 - 8 micronas hp h-pin polarity this bit defines the polarity of the h pin. (master and slave mode). 0: normal polarity (active high). 1: negative polarity. corp cor-pin polarity this bit defines the polarity of the cor pin. (master and slave mode). 0: normal polarity (active high). 1: negative polarity (not allowed for corbl = 1). blankp blank-pin polarity this bit defines the polarity of the blank pin. (master and slave mode). 0: negative polarity (not allowed for corbl = 1). 1: normal polarity (active high). vsu (3 ? 0) vertical set up time. (slave mode only) the vertical sync signal is internally sampled with the next edge of the horizontal sync edge. the phase relation between v and h differs from application to application. to guarantee (vertical) jitter free processing of external sync signals, the vertical sync impulse can be delayed before it is internally processed. the following formula shows how to delay the external v-sync before it is internally latched and processed. t v_delay = 3.84 s ? vsu corbl 3-level contrast reduction output there is one pin each for blank and cor. nevertheless by means of corbl the user is able to switch the cor signal to a three level signal providing blank and contrast reduction information on pin blank simultaneously. 0: two level signal for contrast reduction. 1: three level signal level0: blank off; cor off. level1: blank off; cor on. level2: blank on; cor off. note: please refer to chapter 14 for the detailed specification of these levels. bit function
sda 6000 preliminary data sheet version 2.1 sync system 9 - 9 micronas vlr reset value: 0271 h hpr reset value: 855 h bit function vlr (9 ? 0) amount of vertical lines in a frame. ( master mode only ). m2 generates vertical sync impulses in sync master mode. if, for example, a normal pal timing should be generated, set the register to ? 625d ? and set the interlace bit to ? 0 ? . the hardware will generate a vertical impulse periodically after 312.5 lines. if a non-interlaced picture with 312 lines should be generated, set this register to ? 312 ? and set the interlace bit to ? 1 ? . the hardware will generate a vertical impulse every 312 lines. progressive timing can be generated by setting vlr to ? 625 ? and interlace to ? 1 ? . bit function hpr (11 ? 0) horizontal period factor. ( master mode only ) this register allows the period of the horizontal sync signal to be adjusted. the horizontal period is independent of the pixel frequency and can be adjusted with the following resolution: 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw - - - - - - vl(9..0) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw - - - - hp(11..0) t h-period = hp ? 30 ns
sda 6000 preliminary data sheet version 2.1 sync system 9 - 10 micronas sdv reset value: 0020 h sdh reset value: 0020 h bit function sdv (9 ? 0) vertical sync delay. (master and slave mode). this register defines the delay (in lines) from the vertical sync to the first line of pixel layer 1 on the screen. bit function sdh (11 ? 0) horizontal sync delay. (master and slave mode). this register defines the delay (in pixels) from the horizontal sync to the first pixel of layer 1 on the screen. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw - - - - - - sdv(9..0) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw - - - - sdh
sda 6000 preliminary data sheet version 2.1 sync system 9 - 11 micronas hcr reset value: 0a00 h the clamp phase area has higher priority than the screen background area or the pixel layer area and can be shifted independent from any other register. bit function bhcr (7 ? 0) beginning of horizontal clamp phase. (master and slave mode). this register defines the delay of the horizontal clamp phase from the positive edge of the horizontal sync impulse (normal polarity is assumed). the beginning of the clamp phase can be calculated by the following formula: t h_clmp_b = 480 ns ? bhc ehcr (7 ? 0) end of horizontal clamp phase. (master and slave mode). this register defines the end of the horizontal clamp phase from the positive edge of the horizontal sync impulse (at normal polarity). the end of the clamp phase can be calculated by the following formula: t h_clmp_e = 480 ns ? ehc if ehc is smaller than bhc the clamp phase will include the h-sync phase. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw ehcr(7..0) ehcr(7..0)
sda 6000 preliminary data sheet version 2.1 sync system 9 - 12 micronas figure 9-2 priority of clamp phase, screen background and pixel layer area bvcr reset value: 0000 h bit function bvcr (9 ? 0) beginning of vertical clamp phase. (master and slave mode). this register defines the beginning of the vertical clamp phase from the positive edge of the vertical sync impulse (at normal polarity) in line count. ued11169 clamp phase area screen background area pixel layer area video h period - frame n h pulse rw - - - - - - bvcr(9..0) 5 4 3 2 1 0 7 6 bvcr0 bvcr1 11 10 9 8 15 14 13 12
sda 6000 preliminary data sheet version 2.1 sync system 9 - 13 micronas evcr reset value: 000a h bit function evcr (9 ? 0) end of vertical clamp phase. (master and slave mode). this register defines the end of the vertical clamp phase from the positive edge of the vertical sync impulse (at normal polarity) in line count. note: it must be guaranteed that the value evcr is always smaller than the value of sdv. rw - - - - - - evcr(9..0) 5 4 3 2 1 0 7 6 evcr0 evcr1 11 10 9 8 15 14 13 12
display generator
sda 6000 preliminary data sheet version 2.1 display generator 10 - 3 micronas 10 display generator
sda 6000 preliminary data sheet version 2.1 display generator 10 - 4 micronas 10.1 general description m2 ? s display concept is based on frame buffer technology, which means that for each pixel displayed on a screen appropriate information is stored in the memory of the so called frame buffer. to relieve the controller from processing time consuming tasks like writing this frame buffer pixel by pixel, a graphic accelerator machine is introduced (ga). the ga reads e.g. bitmap information in various formats together with attributes which define the final behavior of those bitmaps. depending on these attributes these bitmaps are processed and written into the frame buffer. due to the processor like architecture of the ga, it is controlled by so called gais (graphic accelerator instructions). the screen refresh unit (sru) reads out the pixel based information (various formats are also available here) and hands them over via a look up table and a fifo to the d/a converter. the fifo is used to adapt the variable pixel output frequency to the fixed memory bus frequency. up to two frame buffers are possible and supported by ga and sru.
sda 6000 preliminary data sheet version 2.1 display generator 10 - 5 micronas 10.2 screen alignments two hw-layers are supported: layer 1 and layer 2. layer 2 can be positioned relative to layer 1 (also in negative direction). if layer 2 exceeds the dimensions of layer 2 these exceeding parts are not visible on the screen. the alignment of the osd on the screen depends on the configuration of layer 1. the maximum amount of displayable pixels is 2047 pixels in horizontal direction and 1023 pixels in vertical direction.
sda 6000 preliminary data sheet version 2.1 display generator 10 - 6 micronas to adapt m2 to a wide range of displays in the market the sync-processing can be flexibly configured. figure 10-1 display regions and alignments there are three registers in the synchronization unit which are necessary for osd setup:  sdh: used to setup the horizontal position of the top left pixel of layer 1.  sdv : used to setup the vertical position of the top left pixel of layer 1.  pfr: used to setup the pixel frequency. for detailed description of these registers please refer to chapter ? display sync system ? and ? clock system ? . in the area which is defined for layer 1 or layer 2 (layer area) each pixel is defined by the attribute definition of the frame buffer. there is no pixel by pixel definition for the blacklevel clamping area and the screen background area. for these areas the colour and transparency is defined as follows: transparency level and colour of the screen background area is defined globally for the whole screen by ga instruction sar. during the blacklevel clamping area, black value (rgb = ? 000 ? ) is delivered at rgb output. pin ? blank ? is set to ? 1 ? and cor-pin is set to ? 0 ? (normal polarity is assumed). ued11170 horizontal blacklevel clamping vertical blacklevel clamping screen background area height variable variable width layer 1 area area non-visible part of layer 2 layer 2
sda 6000 preliminary data sheet version 2.1 display generator 10 - 7 micronas 10.3 layer concept m2 supports two hw-layers. frame buffers of layer 1 and layer 2 can be placed at any word aligned position in external memory. two different layer modes can be chosen:  overlapped layers. layer 1 and layer 2 are processed in parallel by the screen refresh unit.  embedded layers. layer 1 and layer 2 are alternatively processed. if the area of layer 2 exceeds the area of layer 1, these parts are not visible on the screen. mixing of layer 1 and layer 2 is performed by the display generator. as a result of the rgb output of m2, there is only one rgb stream which contains the information of layer 1 and layer 2. this rgb stream is externally mixed with a video source. for this external mixing there are two output signals (cor and blank) available. meshed areas: a special mesh mode is defined to mix the external video with the rgb information from m2 in a chess-pattern-shape. from frame to frame this chess-pattern is inverted. inverted means, that pixels which have been displayed as video in the previous frame, are displayed as rgb in the following frame. figure 10-2 behavior of blank pin for consecutive frames in ? meshed ? regions uea11171 t t +1 +2 t blank = 1; external video blank = 0; rgb of m2
sda 6000 preliminary data sheet version 2.1 display generator 10 - 8 micronas 10.3.1 overlapped layers in overlapped layer mode the pixel information of both layers (layer 1, layer 2) is read in parallel to the ram. this means that for each pixel the individual decision can be made which pixel source (layer 1, layer 2, screen background or video) has the highest priority. figure 10-3 priority of layers in overlapped layer mode the transparency between layers is supported. below layer 2 there is layer 1, below layer 1 there is the screen background colour and below screen background there is video. in overlapped layer mode a transparency hierarchy is defined for layer 2, layer 1, screen background and video. the transparency hierarchy is controlled, for each pixel, by two bits (tr1 ? 0) which are defined in the pixel format of the framebuffer and bit sbtl which is defined in instruction sar. thus each pixel position can be defined individually as layer 1, layer 2, screen background, video or contrast reduced video. depending on the transparency bits of both layers, subsequent signals are switched to the rgb, cor and blank (normal polarity assumed) outputs of m2. as a result one of the two layers or the screen background will be visible on the screen. if layer 2 is not available for a pixel, signals cor, blank and rgb output depends on layer 1 only. uea11172 layer 2 layer 1 background color video
sda 6000 preliminary data sheet version 2.1 display generator 10 - 9 micronas table 10-1 behavior of m2 ? s outputs in overlapped layer mode layer 1 layer 2 screen background blank pin cor pin rgb pins rgb tube tr1 tr0 tr1 tr0 sbtl 0 0 n.a. *1) n.a. 0 0 0 layer 1 layer 1 0 1 n.a. n.a. 0 meshed 0 layer 1 layer 1/ video 1 0 n.a. n.a. 0 0 0 back- ground back- ground 1 1 n.a. n.a. 0 0 0 back- ground back- ground x *2) x 0 0 0 0 0 layer 2 layer 2 x x 0 1 0 meshed 0 layer 2 layer 2/ video 0 0 1 x 0 0 0 layer 1 layer 1 0 1 1 x 0 meshed 0 layer 1 layer 1/ video 1 0 1 x 0 0 0 back- ground back- ground 1 1 1 x 0 0 0 back- ground back- ground 0 0 n.a. n.a. 1 0 0 layer 1 layer 1 0 1 n.a. n.a. 1 meshed 0 layer 1 layer 1/ video 1 0 n.a. n.a. 1 1 0 back- ground video 1 1 n.a. n.a. 1 1 1 back- ground contrast red. video x x 0 0 1 0 0 layer 2 layer 2 x x 0 1 1 meshed 0 layer 2 layer 2/ video 0 0 1 x 1 0 0 layer 1 layer 1 0 1 1 x 1 meshed 0 layer 1 layer 1/ video
sda 6000 preliminary data sheet version 2.1 display generator 10 - 10 micronas *1) n.a. = not available *2) x = don ? t care for transparency in ? screen background area ? please refer to chapter 10.3.3 . 10.3.2 embedded layers layer 1 and 2 are not read in parallel to the ram. the sru reads only one layer at a time. during the area of layer 2 only pixels of layer 2 are read. otherwise only layer 1 is read. as a result in the area of layer 2, the pixel information for layer 1 is not available. this is why layer 2 is transparent to video and not to layer 1. as a result, in embedded layer mode, transparency between layers is only supported layer-wise not pixel-wise. also please refer to transparency using overlapped layers ( chapter 10.3.1 ). 1 0 1 x 1 1 0 back- ground video 1 1 1 x 1 1 1 back- ground contrast red. video table 10-1 behavior of m2 ? s outputs in overlapped layer mode (cont ? d) layer 1 layer 2 screen background blank pin cor pin rgb pins rgb tube tr1 tr0 tr1 tr0 sbtl
sda 6000 preliminary data sheet version 2.1 display generator 10 - 11 micronas . figure 10-4 priority of layers in embedded layer mode depending on the transparency bits of both layers, the following signals are switched to the rgb, cor and blank (normal polarity assumed) outputs of m2. as a result, one of the two layers or the screen background will be visible on the screen. if layer 2 is not available for a pixel, signals cor, blank and rgb output depends only on layer 1. the transparency hierarchy is again controlled, for each pixel, by two bits (tr1 ? 0) which are defined in the pixel format. on the rgb output of m2 there is a mix of layer 1 and layer 2 rgb stream with the screen background. depending on the transparency bits of one of the layers subsequent signals are switched to rgb, cor and blank (normal polarity assumed). the output signals of m2 (cor, blank, rgb) depend only on transparency bits of layer 1 or on layer 2 and never on both layers because there is no pixel position where both layers are available in parallel. 10.3.3 transparency in screen background area depending on the height and width definition of layer 1 there is a remaining portion of visible screen area without any pixel definition of layer 1 or layer 2. for this area the transparency bits for layer 1 and layer 2 are not available. for this ? screen background area ? the colour attributes and transparency attributes are globally defined for the whole screen. also refer to instruction sar described in chapter 10.7.1 . uea11173 layer 2 layer 1 background color video
sda 6000 preliminary data sheet version 2.1 display generator 10 - 12 micronas table 10-2 behavior of m2 ? s outputs in embedded layer mode layer 1 layer 2 screen back- ground blank pin cor pin rgb pins rgb tube tr1 tr0 tr1 tr0 sbtl 0 0 n.a. n.a. 0 0 0 layer 1 layer 1 0 1 n.a. n.a. 0 meshed 0 layer 1 layer 1 / video 1 0 n.a. n.a. 0 0 0 back- ground back- ground 1 1 n.a. n.a. 0 0 0 back- ground back- ground n.a. n.a. 0 0 0 0 0 layer 2 layer 2 n.a. n.a. 0 1 0 meshed 0 layer 2 layer 2 / video n.a. n.a. 1 0 0 0 0 back- ground back- ground n.a. n.a. 1 1 0 0 0 back- ground back- ground 0 0 n.a. n.a. 1 0 0 layer 1 layer 1 0 1 n.a. n.a. 1 meshed 0 layer 1 layer 1 / video 1 0 n.a. n.a. 1 1 0 back- ground video 1 1 n.a. n.a. 1 1 1 back- ground contrast red. video n.a. n.a. 0 0 1 0 0 layer 2 layer 2 n.a. n.a. 0 1 1 meshed 0 layer 2 layer 2 / video n.a. n.a. 1 0 1 1 0 back- ground video n.a. n.a. 1 1 1 1 1 back- ground contrast red. video
sda 6000 preliminary data sheet version 2.1 display generator 10 - 13 micronas table 10-3 behavior of m2 ? s outputs in background area screen background blank pin cor pin rgb pins rgb tube str1 str0 0 000rgb values defined in sar rgb values defined in sar 0 1 meshed 0 rgb values defined in sar rgb values defined in sar/video 1 010rgb values defined in sar video 1 111rgb values defined in sar contrast red. video
sda 6000 preliminary data sheet version 2.1 display generator 10 - 14 micronas 10.4 input and output formats the transfer of one memory area to another is executed by the graphic accelerator (ga). transfer means reading data from a source memory area in a given input format, modifying the data and writing it in a defined output format to the destination memory area. different input and output formats are supported: note: 1) the 2-bit format is defined as a format for the frame buffer but not supported by the ga. table 10-4 overview on formats input formats output formats 1-bit bitmap 2-bit format clut2 vector 1) 2-bit bitmap 8-bit format clut2 vector 4-bit bitmap 16-bit format (4:4:4:2) rgb 8-bit bitmap 16-bit format (ttx) clut2 vector 8-bit data (for direct data transfer) 16-bit format (5:6:5) rgb clut1 input 8-bit data (for direct data transfer) 16-bit format (4:4:4:2) ?
sda 6000 preliminary data sheet version 2.1 display generator 10 - 15 micronas 10.4.1 input formats the following figures describe how bitmaps for different input bit map formats are stored in the source memory area . the 16-bit format is described in figure 10-12 . figure 10-5 format of 1-bitplane bitmap note: the 1-bitplane format is used to address vectors 1 ? 0 of clut1. figure 10-6 format of 2-bitplane bitmap note: the 2-bitplane format is used to address vectors 3 ? 0 of clut1. figure 10-7 format of 4-bitplane bitmap note: the 4-bitplane format is used to address vectors 15 ? 0 of clut1. ued11174 memory addr. = n memory addr. = n+2 bit_1 bit_5 bit_7 bit_6 bit_3 byte address n+1 bit_4 bit_2 bit_1 bit_5 byte address n bit_7 bit_0 bit_6 bit_3 bit_4 bit_2 bit_0 byte address n+3 byte address n+2 14 pixel 10 pixel 8 pixel 9 pixel 12 pixel 11 pixel 13 pixel 6 pixel 2 pixel 0 pixel 15 pixel 1 pixel 4 pixel 3 pixel 5 pixel 7 pixel 30 pixel pixel 26 24 pixel 25 pixel 28 pixel pixel 27 pixel 29 22 pixel 18 pixel 16 pixel pixel 31 17 pixel 20 pixel 19 pixel 21 pixel 23 pixel ued11175 memory addr. = n+2 memory addr. = n 13/bit1 pixel/ pixel 12/bit0 pixel 12/bit1 pixel/ 13/bit0 pixel 14/bit1 pixel 14/bit0 pixel 15/bit1 pixel 15/bit0 pixel 8/bit1 pixel 8/bit0 pixel 9/bit1 pixel 9/bit0 pixel 10/bit1 pixel 10/bit0 pixel 11/bit1 pixel 11/bit0 3/bit1 pixel 1/bit1 pixel 0/bit1 pixel 0/bit0 pixel 2/bit1 pixel 1/bit0 pixel 2/bit0 pixel 3/bit0 pixel 7/bit1 pixel pixel 5/bit1 4/bit1 pixel 4/bit0 pixel 6/bit1 pixel pixel 5/bit0 pixel 6/bit0 pixel 7/bit0 byte address n+1 byte address n+3 byte address n+2 byte address n bit_7 bit_6 bit_5 bit_4 bit_3 bit_2 bit_1 bit_0 bit_7 bit_6 bit_5 bit_4 bit_3 bit_2 bit_1 bit_0 ued11176 memory addr. = n+2 memory addr. = n 6/bit1 pixel pixel 6/bit2 pixel 6/bit3 pixel 6/bit0 pixel 7/bit3 pixel 7/bit2 pixel 7/bit1 pixel 7/bit0 pixel 4/bit3 pixel 4/bit2 pixel 4/bit1 pixel 4/bit0 pixel 5/bit3 pixel 5/bit2 pixel 5/bit1 pixel 5/bit0 1/bit1 pixel 0/bit1 pixel 0/bit3 pixel 0/bit2 pixel 1/bit3 pixel 0/bit0 pixel 1/bit2 pixel 1/bit0 pixel 3/bit1 pixel pixel 2/bit1 2/bit3 pixel 2/bit2 pixel 3/bit3 pixel pixel 2/bit0 pixel 3/bit2 pixel 3/bit0 byte address n+1 byte address n+3 byte address n+2 byte address n bit_7 bit_6 bit_5 bit_4 bit_3 bit_2 bit_1 bit_0 bit_7 bit_6 bit_5 bit_4 bit_3 bit_2 bit_1 bit_0
sda 6000 preliminary data sheet version 2.1 display generator 10 - 16 micronas figure 10-8 format of 8-bitplane bitmap note: the 8-bitplane format is used to address vectors 255 ? 0 of clut1. 10.4.2 output formats the output of the ga is the input of the sru. the sru contains a 256 ? 14-bit colour look up table (clut2). this clut2 contains 256 different rgb values with 4 bits for each colour (4:4:4) and 2-bit transparency information. 2-bit formats, 8-bit formats and the ttx format are using this clut2. for 16-bit formats (ttx or 4:4:4:2) it depends on bit ? m ? (mode), if the 16-bit information is used as colour look up vectors or the 16-bit information is bypassing clut2. the 5:6:5 format always bypasses clut2. figure 10-9 overview on sru ued11177 memory addr. = n+2 memory addr. = n 3/bit5 pixel pixel 3/bit6 pixel 3/bit7 pixel 3/bit4 pixel 3/bit3 pixel 3/bit2 pixel 3/bit1 pixel 3/bit0 pixel 2/bit7 pixel 2/bit6 pixel 2/bit5 pixel 2/bit4 pixel 2/bit3 pixel 2/bit2 pixel 2/bit1 pixel 2/bit0 0/bit1 pixel 0/bit5 pixel 0/bit7 pixel 0/bit6 pixel 0/bit3 pixel 0/bit4 pixel 0/bit2 pixel 0/bit0 pixel 1/bit1 pixel pixel 1/bit5 1/bit7 pixel 1/bit6 pixel 1/bit3 pixel pixel 1/bit4 pixel 1/bit2 pixel 1/bit0 byte address n+1 byte address n+3 byte address n+2 byte address n bit_7 bit_6 bit_5 bit_4 bit_3 bit_2 bit_1 bit_0 bit_7 bit_6 bit_5 bit_4 bit_3 bit_2 bit_1 bit_0 ued11178 display generator interface (dgi) memory ga dg (256 x 14) clut2 sru fifo rgb
sda 6000 preliminary data sheet version 2.1 display generator 10 - 17 micronas the different formats of pixels stored in a frame buffer which are used by the sru are described in the following paragraphs: frame buffer in 2-bit pixel format using this format, the frame buffer contains colour vectors. these 2-bitplane colour vectors will be converted into 4:4:4:2 format (r:g:b: transparency value) by addressing vector 252 ? 255 of clut2. figure 10-10 2-bit pixel format for use in frame buffer frame buffer in 8-bit pixel format using this format, the frame buffer contains colour vectors. these 8-bitplane colour vectors will be converted into 4:4:4:2 format (r:g:b: transparency value) by clut2. figure 10-11 8-bit pixel format for use in frame buffer frame buffer in 16-bit pixel format (4:4:4:2 or ttx) this 16-bit format supports an rgb mode (4:4:4:2) and a ttx mode. which of these modes is in use can be decided pixel by pixel with bit ? m ? :  ttx format (m = ? 0 ? )  12-bitplanes rgb (4:4:4:2) format (m = ? 1 ? ) with 2 transparency bits tr(1 ? 0). note: the meaning of transparency bits is described in more detail in chapter 10.3.1 and chapter 10.3.2 . ued11179 pixel0 10101010 76 3 54 210 pixel1 pixel2 pixel3 ued11180 76 3 54 210 pixel (7...0)
sda 6000 preliminary data sheet version 2.1 display generator 10 - 18 micronas figure 10-12 16-bit pixel format (4:4:4:2/ttx) for use in frame buffer pixels in 16-bit format which are stored in ttx format contain two 5-bit colour look up vectors and two flash mode indicator bits. the flash mode indicator bits are used to choose the flash rate and the flash phase. the meaning of flash is: the colour alternates between two 5-bit colour vectors (flashc and pixel) which are chosen within the format definition.  non flash : flash can be disabled if both 5-bit colour vectors point to the same clut2 location.  inverted flash : inverted flash is supported by exchanging the ? flashc ? vector with the ? pixel ? vector. ued11181 m tr(1..0) pixel(12..0) flashc(4..0) 3) pixel(4..0) 4) (2..0) c 2) blue(3..0) green(3..0) 5) 5) red(3..0) 5) i 1) 11 1 0 00 1 0 0 1 1 1 1 0 0 0 2 hz flash, phase 3 2 hz flash, phase 2 2 hz flash, phase 1 1 hz flash 0 transparency level 1 transparency level 2 transparency level 3 transparency level 4 1 format 16-bit ttx format 16-bit 4:4:4:2 1) i - italic subpixel c - clut2 selector in ttx mode 2) flashc - clut2 vector for flash colour in ttx mode 3) pixel - clut2 vector for pixel in ttx mode 4) red green blue - pixel rgb colour in 4:4:4:2 mode 5)
sda 6000 preliminary data sheet version 2.1 display generator 10 - 19 micronas figure 10-13 internally generated flash signals in different flash phases 5-bit colour look up vectors are converted into a 12-bit rgb value and a 2-bit transparency level by clut2 during display. to do this, the input side of clut2 the 5- bit look up value is used for bit0 to bit4, the c 2 -values are used as bit7 to bit5. the 12- bit rgb value is fed to the d/a converter and the 2-bit transparency information to the blank/cor pins. 16-bit format pixels which are stored in the 12-bit rgb format are not passing the clut2. the 12-bit rgb value and the 2-bit transparency information is directly fed into the d/a converter and the blank/cor pins. frame buffer in 16-bit pixel format (5:6:5) in this mode the frame buffer contains rgb values with 5 bits for red colour components, 6 bits for green colour components and 5 bits for blue colour components: figure 10-14 16-bit pixel format (5:6:5) for use in frame buffer transparency between layers is not supported if this mode is in use. the 5:6:5 format is directly transferred to the d/a converter. clut2 is out of use in this mode. ued11182 fast rate flash. phase 3. normal flash fast rate flash. phase 2. normal flash fast rate flash. phase 1. normal flash slow rate flash. normal flash ued11183 blue green red green 4321054321043210 15 14 11 13 12 10 9 7 864 53 0 21
sda 6000 preliminary data sheet version 2.1 display generator 10 - 20 micronas 10.5 initialization of memory transfers transferring an input format of the source area to an output format in the destination area is supported by different transfer modes. for this, a pixel modification unit and clut1 of the ga is used. clut1 has a size of 256 ? 16 bit. next to the transfer mode the transfer areas (source and destination) must be defined by ga instructions. source is either an address in the external memory or a constant value coming from clut1. destination is always an address in the external memory. constant values coming from clut1 are used to draw lines or fill parallelograms. figure 10-15 overview of ga 10.5.1 transfer modes different transfer modes are available. the table below shows all possible combinations of input and output formats. ? transparency available ? means that if transparency mode is chosen (see also gai- instruction ? tar ? (bit: trm)) and bit tr1 of the output word is set to ? 0 ? (refer also to figure 10-12 ) this pixel is written to the destination, otherwise this pixel is not written to the destination. ? modification ? describes in which way the output information is generated by using the input information, clut1 and the settings of the ? tar ? -instruction. using 16-bit ttx output two bits are replaced by another 2 bits (flash) which are also defined by graphic accelerator instruction ? tar ? . the table below shows all possible combinations of input and output formats: display generator interface (dgi) ued11184 memory ga dg (256 x 16) pixel modification clut1 sru
sda 6000 preliminary data sheet version 2.1 display generator 10 - 21 micronas table 10-5 supported transfer modes tmod (4 ? 0) input format output format transparency available modification 00000 1-bit bitmap 16-bit (ttx) no out(15) = ? 0 ? out(14 ? 13) = fla(1 ? 0) out(12 ? 0) = clut1( ? 0000000 ? & in(0))(12 ? 0) 00001 1-bit bitmap 16-bit (4:4:4:2) yes out(15) = ? 1 ? out(14 ? 13) = clut1( ? 0000000 ? & in(0))(14 ? 13)) out(12) = it out(11 ? 0) = clut1( ? 0000000 ? & in(0))(11 ? 0)) 00010 1-bit bitmap 8-bit no out(7 ? 0) = clut1( ? 0000000 ? & in(0))(7 ? 0) 00011 1-bit bitmap 16-bit (5:6:5) no out(15 ? 0) = clut1( ? 0000000 ? & in(1 ? 0))(15 ? 0)) 00100 2-bit bitmap 16-bit (ttx) no out(15) = ? 0 ? out(14 ? 13) = fla(1 ? 0) out(12 ? 0) = clut1( ? 000000 ? & in(1 ? 0))(12 ? 0) 00101 2-bit bitmap 16-bit (4:4:4:2) yes out(15) = ? 1 ? out(14 ? 13) = clut1( ? 0000000 ? & in(1 ? 0))(14 ? 13)) out(12) = it out(11 ? 0) = clut1( ? 0000000 ? & in(1 ? 0))(11 ? 0)) 00110 2-bit bitmap 8-bit no out(7 ? 0) = clut1( ? 000000 ? & in(1 ? 0))(7 ? 0) 00111 2-bit bitmap 16-bit (5:6:5) no out(15 ? 0) = clut1( ? 000000 ? & in(1 ? 0))(15 ? 0)) 01000 4-bit bitmap 16-bit (ttx) no out(15) = ? 0 ? out(14 ? 13) = fla(1 ? 0) out(12 ? 0) = clut1( ? 0000 ? & in(3 ? 0))(12 ? 0)
sda 6000 preliminary data sheet version 2.1 display generator 10 - 22 micronas 01001 4-bit bitmap 16-bit (4:4:4:2) yes out(15) = ? 1 ? out(14 ? 13) = clut1( ? 0000000 ? & in(3 ? 0))(14 ? 13)) out(12) = it out(11 ? 0) = clut1( ? 0000000 ? & in(3 ? 0))(11 ? 0)) 01010 4-bit bitmap 8-bit no out(7 ? 0) = clut1( ? 0000 ? & in(3 ? 0))(7 ? 0) 01011 4-bit bitmap 16-bit (5:6:5) no out(15 ? 0) = clut1( ? 0000 ? & in(3 ? 0))(15 ? 0)) 01100 8-bit bitmap 16-bit (ttx) no out(15) = ? 0 ? out(14 ? 13) = fla(1 ? 0) out(12 ? 0) = clut1(in(7 ? 0))(12 ? 0) 01101 8-bit bitmap 16-bit (4:4:4:2) yes out(15) = ? 1 ? out(14 ? 13) = clut1( ? 0000000 ? & in(7 ? 0))(14 ? 13)) out(12) = it out(11 ? 0) = clut1( ? 0000000 ? & in(7 ? 0))(11 ? 0)) 01110 8-bit bitmap 8-bit no out(7 ? 0) = clut1(in(7 ? 0))(7 ? 0) 01111 8-bit bitmap 16-bit (5:6:5) no out(15 ? 0) = clut1(in(7 ? 0))(15 ? 0)) 10000 clut1 input 8-bit no out(7 ? 0) = clut1(0)(7 ? 0) 10001 clut1 input 16-bit (ttx) no out(15) = ? 0 ? out(14 ? 13) = fla(1 ? 0) out(12 ? 0) = clut1(0)(12 ? 0) 10010 clut1 input 16-bit (4:4:4:2) yes out(15) = ? 1 ? out(14 ? 0) = clut1(0)(14 ? 0)) 10011 16-bit (ttx or 4:4:4:2) 16-bit (ttx or 4:4:4:2) only in 4:4:4:2 mode out(15 ? 0) = in(15 ? 0) table 10-5 supported transfer modes (cont ? d) tmod (4 ? 0) input format output format transparency available modification
sda 6000 preliminary data sheet version 2.1 display generator 10 - 23 micronas note: there is no transfer mode defined which uses the 2-bit format as an output format, because in this case layer 2 is restricted to a width of 64 pixels. if the 2-bit format is required, the direct byte by byte transfer can be used. 10.5.2 transfer areas next to the transfer mode the transfer area has to be defined by graphic accelerator instructions (gai). for source and destination, ? linear ? and ? rectangle ? areas can be defined. ? linear ? means that data is accessed byte by byte without any irregularity in the addressing of the memory. ? rectangle ? means that after the access of n bytes defined by a parameter ? width ? an ? offset ? to the last address is automatically added. this feature can be used if an array of data has to be copied from one memory location into another (bigger) array at any other memory location. the linear addressing is a subset of the rectangle addressing scheme if ? offset ? is set to ? 0 ? . source area there are different settings necessary to define the source area. these settings are done by using the graphic accelerator instruction set. the table below describes the necessary settings and corresponding gais with the affected bit position inside the gai: 10100 8-bit data 8-bit data no out(7 ? 0) = in(7 ? 0) others reserved used gai bit position inside gai description sdr s_addr start address of source area tsr width_in width of source area tor s_offset offset to describe rectangular source areas table 10-5 supported transfer modes (cont ? d) tmod (4 ? 0) input format output format transparency available modification
sda 6000 preliminary data sheet version 2.1 display generator 10 - 24 micronas as described before, there are seven different formats on the input side of the transfer:  1-bit bitmap  2-bit bitmap  4-bit bitmap  8-bit bitmap  8-bit data (used for direct data transfer)  clut1 input (used for drawing of filled parallelograms, rectangles, lines)  16-bit (4:4:4:2) rgb clut1 input does not need any more detailed area description. the input value comes directly from the address ? 0 ? of clut1 and not from the ram. this mode can be used for drawing lines, filling rectangles or parallelograms. for the other input modes a more detailed description is given below: from the point of view of the register settings, which are used to define the source area, the different input formats can be divided in three groups which are handled in different ways. group 1: group 2: group3: 1-bit bitmap8-bit data16-bit pixel format (4:4:4:2) 2-bit bitmap8-bit bitmap 4-bit bitmap formats of group 1 are formats which define each pixel with less than a byte. group 2 formats are formats which define each pixel by 8 bits, and group 3 formats are formats which define each pixel by 16 bits. group 1: in 1-bit bitmap, 2-bit bitmap and 4-bit bitmap input mode it is expected, that the bitmaps are stored linearly in the memory as described in chapter 10.4.1 . therefore the settings of width_in as well as s_offset are ignored. only the 24-bit source address pointer s_addr is used. the amount of pixels which are read from the source and written to the destination is only defined by the destination settings. the user has to take care that the destination settings fit with the bitmap inherent alignments. group 2: in this mode width_in and s_offset are also taken into account. the amount of memory which is described by width_in and s_offset is described by numbers of bytes. group 3: in this mode width_in and s_offset are also taken into account. the amount of memory which is described by width_in and s_offset is described by numbers of words. note: the number of bytes to be read from the source area is defined by the destination area (see below) and the transfer mode. this is why no explicit definition of height is needed for the source.
sda 6000 preliminary data sheet version 2.1 display generator 10 - 25 micronas figure 10-16 use of register settings to specify source area destination area there are additional settings necessary to define the destination area. the table below describes the settings and the corresponding gais with the affected bit position inside the gai: next to the destination area itself a clipping area can be defined. the clipping area needs to be defined within the destination area. during a memory transfer these ? clipped ? memory areas are excluded from the transfer. the table below describes the settings and the corresponding gais with the affected bit positions inside the gai: used gai bit position inside gai description ddr d_addr start address of destination area tdr height_out, width_out height and width of destination area tor d_offset offset to describe rectangular destination areas used gai bit position inside gai description cur c_addr start address of clipping area cbr height_clip, width_clip height and width of clipping area cbr, cur c_offset offset to describe rectangular clipping areas ued11185 s_addr s_offset (tor) memory width_in (tsr) source area
sda 6000 preliminary data sheet version 2.1 display generator 10 - 26 micronas as described before, there are five different formats on the output side of the transfer: (also please refer to chapter 10.4.2 )  8-bit format clut2 vector  16-bit format (4:4:4:2) rgb  16-bit format (ttx) clut2 vector  16-bit format (5:6:5) rgb  direct data transfer (byte by byte) from the point of view of the register settings which are used to define the alignment of the destination area, these formats can be divided in two groups. each group is handled in a different way. group 1: group 2: 16-bit format (4:4:4:2) rgb 8-bit format clut2 vector 16-bit format (ttx) clut2 vector 8-bit data (byte by byte transfer) 16-bit format (5:6:5) rgb formats of group 1 are formats which define each pixel by 16 bits. group 2 formats are formats which define each pixel by 8 bits. note: bit fields height_clip, height_out and width_clip, width_out describe the height and width of the destination in count of pixels and not in bytes. so for output formats of group 1 the memory area which is described by a height_out value and a width_out value needs the double amount of memory, than output formats which are described by the same height_out value and width_out value for output formats of group 2. also, the offset values are pixels and not bytes or words. c_addr and d_addr are real byte addresses in memory. note: for a rectangle destination area the sum of width and d_offset of the destination area must be equal to the width of the frame buffer (width_l1(2)). otherwise the shape of the copied frame will be a parallelogram and not a rectangle. note: for a rectangle clipping area inside the destination area the sum of the clipping offset and the clipping width must be the same as the sum of the destination area width and the destination offset. otherwise the clipping area will be a parallelogram and not a rectangle. note: source area and destination area should not overlap. otherwise it may appear that a pixel is overwritten as a destination pixel, and afterwards used as a source pixel.
sda 6000 preliminary data sheet version 2.1 display generator 10 - 27 micronas meaning of double width and double height during transfer the destination area can be stretched horizontally and vertically by using ga instruction tar. if double width (tdw) is set to ? 1 ? , the graphic accelerator writes each pixel twice horizontally to the destination area. if double height (tdh) is set to ? 1 ? in the destination output side each pixel in vertical direction is repeated twice. for example: if double width is set to ? 1 ? and quadruple height is set to ? 1 ? each pixel of the source area needs 8 pixels of the destination area. note: parameters like width_out, width_clip, height_out and height_clip are still pixel related. width_out, height_out and d_offset have to be adapted by the software to get a complete character. clipping is not affected by tdh and tdw. the following table is an example of a 1-bit bitmap (30 ? 50) which should be transferred either in normal size or in double size to an 8 bit output format in a frame buffer with a size of 100 ? 200 pixels. note: in case of double width transfer width_out has to be an even number. in case of double/quad height transfer height_out has to be an even/divisable by 4 number. tqh tdh meaning 00 normal transfer 01 if double height (tdh) is set to ? 1 ? and quadruple height (tqh) is set to ? 0 ? in the destination output side each pixel in vertical direction is repeated twice. 1x if quadruple height (tqh) is set to ? 1 ? on the destination output side each pixel in vertical direction is repeated four times. parameters tdw = 0; tdh = 0; tqh = 0 tdw = 1; tdh = 1; tqh = 0 width_l1 100 height_l1 200 width_in 30 width_out 30 60 d_offset 70 40 height_out 50 100
sda 6000 preliminary data sheet version 2.1 display generator 10 - 28 micronas figure 10-17 gives a graphical overview of how to specify the different areas. figure 10-17 use of register settings to specify destination and clipping area 10.5.3 italic mode for transfer modes with 16-bit (4:4:4:2) format as an output, an automatic italic transfer option is available. if italic mode is chosen only the destination area (not the source area) is affected. the following two figures explain the different representation of pixels in the frame buffer in non-italic and italic mode. figure 10-18 result for a non-italic transferred memory area in frame buffer ued11186 d_addr d_offset (tor) frame buffer width_out (tdr) destination area width_l1(2) (fsr) height_out (tdr) c_addr fb_addr height_clip (cbr) width_clip (cbr) c_offset (cur, cbr) c_offset (cur, cbr) height_l1(2) (fsr) clipping area ued11187 height_out d_addr d_offset width_out d_offset 0 0 0 0 0 0 0 0 0 0 bit ? i ? of 4:4:4:2 format
sda 6000 preliminary data sheet version 2.1 display generator 10 - 29 micronas if this transfer is executed with the same register settings but in italic mode instead of non italic mode, the subsequent destination area is used inside the frame buffer: figure 10-19 result for a italic transferred memory area in frame buffer next to the destination pixel offset from line to line, the italic bit ( ? i ? ) alternates from line to line. this italic bit is used to control the d/a converter to realize a horizontal line alternating half pixel shift on rgb output. figure 10-20 result for an italic transferred memory area at d/a converter output note: italic can not be used together with double width and double/quad height transfers. ued11188 height_out d_addr d_offset width_out d_offset 0 1 0 1 0 1 0 1 0 1 bit ? i ? of 4:4:4:2 format ued11189
sda 6000 preliminary data sheet version 2.1 display generator 10 - 30 micronas 10.6 register description 10.6.1 special function registers the display generator is controlled by 3 special function registers and a list of accelerator instructions. two of the registers define the position and the length of the instruction list, and one register is used for general control of the dg. after the list of instructions (gais) is written to the memory, the start address and the length of this list must be written to special function registers gprgcrh and gprgcrl. then the controller commands the ga to execute these instructions (see sfr dgcon). after the ga has finished executing all gais, the ga gives the controller an interrupt (gafir). note: gprgcrh, gprgcrl and dgcon are the only special function registers to control the display generator. gais described in the next paragraph are stored in the ram and not defined after power on. gprgcrh reset value: 0000 h gprgcrl reset value: 0000 h dgcon is for general control of the dg. bit function gcr (8 ? 0) defines the amount of gais in the instruction list. gcr ? 4 is the length of the gai area in count of bytes. note: after the last instruction is executed an interrupt is given to the controller gpr (23 ? 17) define the msbs of the 23-bit address pointer to the start of the gai area. bit function gpr (16 ? 1) define the lsbs of the 23-bit address pointer to the start of the gai area. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw gcr (8..0) gpr (23..17) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw gpr (16..1)
sda 6000 preliminary data sheet version 2.1 display generator 10 - 31 micronas dgcon reset value: 0000 h bit function eadg enables access from dg to sdram. 0: all requests from dg (sru and ga) to the memory are disabled. 1: the dg has normal access to the memory. note: the running memory access is finalized before this bit becomes active. eodg enables output of dg. 0: all outputs of the dg are disabled (rgb outputs are switched to black level, cor = 0 and blank = 1) ( ? normal ? pin polarity assumed. please refer also to register scr). 1: the outputs have the function according to the specifications described in the following paragraphs. note: the sru registers fbr and dbr have to be programmed with a valid memory address before enabling display output. stga starts processing of the instruction list by the ga 0: stga has to be reset by sw before the ga can be started again. 1: the ga starts the execution of the instruction list at address gpr. it ends after the specified number of instructions (see bit field gcr) is executed. after that an interrupt (gafir) is given to the controller. gabsy 0: ga is idle, waiting for gai sequence. 1: ga is busy, gai sequence is processed. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw - - - - - - - - - - - - bsy ga st ga eo dg ea dg rw r
sda 6000 preliminary data sheet version 2.1 display generator 10 - 32 micronas the register pxdel controls an individual delay of 0 ? 2 clock cycles of the sru outputs. each output (r, g, b, italic, blank, cor) is contolled by 2 bits in the pxdel register. pxdel reset value: 0000 h bits set to ? 00 ? - no delay ? 01 ? - delay of 1 pixel clock cycle ? 10 ? - delay of 2 pixel clock cycles ? 11 ? - reserved the reset value of pxdel is set to 0000 h , which means no dely of the sru outputs after reset. bits 1 ? 0delay for red 3 ? 2 delay for green 5 ? 4 delay for blue 7 ? 6 delay for italic 9 ? 8 delay for blank 11 ? 10 delay for cor 15 ? 12 reserved 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 res res res res tcor tblank titalic tblu tgreen tred
sda 6000 preliminary data sheet version 2.1 display generator 10 - 33 micronas 10.7 description of graphic accelerator instructions gais are 32-bit instructions which are used as an interface from c to dg. they are written sequentially to the sdram by the controller in form of an instruction list. figure 10-21 shows the organization of gais in the memory. figure 10-21 organization of gais in the external sdram ued11190 byte address n+3+k byte address n+2+k byte address n+1+k byte address n+k gai-no. k gai-no. ... gai-no. 1 byte address n+4 byte address n+5 byte address n+6 byte address n+7 gai-no. 0 byte address n byte address n+1 byte address n+2 byte address n+3 24 8 9 25 10 26 11 27 12 28 13 29 14 30 15 31 gai_byte 1 gai_byte 3 gai_byte 2 gai_byte 0 6 22 7 23 54 21 20 32 19 18 10 16 17 standard format for gais: x 4 4 x 4 x 4 x
sda 6000 preliminary data sheet version 2.1 display generator 10 - 34 micronas in the following gai description, ??? means that these bits are reserved for future use and have to be set to ? 0 ? . the meaning of an instruction is not given by the physical location (address) of the instruction but by its opcode which is represented by bits 31 ? 28. bits 27 ? 0 are equivalent to an operand. figure 10-22 gai instruction format there are two types of gais. one type is used to setup global parameters for sru and ga, like sru setup, frame buffer setup or clut setup. the second type of gai is used to setup the transfer parameters for dma functions. global parameters the following global instructions are only executed by the ga during the vertical sync area. if such a ga-instruction is read by the ga outside the v-sync area, it waits until the next v-sync appears. note: the v-sync area is defined for that purpose as the first 4 lines of a field.  sru setup sar (opcode = 1111) - set screen attributes  frame buffer 1 (layer 1) and frame buffer 2 (layer 2) setup fbr (opcode = 1000) - set address of the beginning of frame buffer 1 fsr (opcode = 1001) - set size of frame buffer 1 dbr (opcode = 1010) - set address of the beginning of frame buffer 2 dsr (opcode = 1011) - set size of frame buffer 2 dcr (opcode = 1100) - set frame buffer 2 reference coordinates  clut setup clr (opcode = 1101) - set contents of the clut1 or clut2 note: if clut2 should be loaded the ga waits until the next v-sync appears.  no operation nop (opcode = 1110) - no operation 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 operand(s) operand(s) opcode
sda 6000 preliminary data sheet version 2.1 display generator 10 - 35 micronas transfer parameters these instructions are immediately executed by the ga.  cur (opcode = 0000) - set clipping coordinates  cbr (opcode = 0001) - set clipping coordinates  sdr (opcode = 0010) - set source descriptor for data transfer  ddr (opcode = 0011) - set destination descriptor for data transfer  tsr (opcode = 0100) - set definitions for source memory area  tdr (opcode = 0101) - set definitions for destination memory area  tor (opcode = 0110) - set offset definitions for transferred area  tar (opcode = 0111) - set attributes for transfer 10.7.1 screen attributes (sar) this instruction controls different screen attributes. sar bit function sbtl screen background transparency under layer area defines whether the screen background area is transparent under a layer 1 (2) area or not. 0: the screen background within a layer area is not transparent. under transparent layer pixels the background colour can be seen. 1: the screen background within a layer area is transparent. under transparent layer pixels the video can be seen. note: transparency definitions for the screen background outside a layer area are made with bits str. also please refer to chapter 10.3.3 . dmode (3 ? 0) display mode bits defines the possible combinations of both layers with the available pixel formats. please see table ? display modes ? below. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 str(1..0) green(3..0) blue(3..0) ddw ddh red(3..0) 1 - - - - - - sb tl dmode(3..0) 1 1 1 -
sda 6000 preliminary data sheet version 2.1 display generator 10 - 36 micronas ddw double width display 0: normal width 1: double width. the contents of the screen are stretched in horizontal direction. the sru repeats the same pixel information twice in horizontal direction. note: ddw = ? 1 ? the frame buffer width (width_l1(l2) has to be divided by two to get the same area displayed on the screen. ddh double height display 0: normal height 1: double height. the contents of the screen are stretched in vertical direction. the sru repeats the same pixel information twice in vertical direction. note: ddh = ? 1 ? the frame buffer height (height_l1(l2) has to be divided by two to get the same area displayed on the screen. str (1 ? 0) screen background transparency level define the transparency of the screen background area outside the layer area. please refer to chapter 10.3.3 . red (3 ? 0) screen background red colour 4-bit red component green (3 ? 0) screen background green colour 4-bit green component blue (3 ? 0) screen background blue colour 4-bit blue component bit function
sda 6000 preliminary data sheet version 2.1 display generator 10 - 37 micronas table 10-6 display modes dmode (3 ? 0) layer formats layer mode layer 1 layer 2 0000 16-bit (4:4:4:2 or ttx) ? layer 2 switched off 0001 8-bit ? layer 2 switched off 0010 16-bit (5:6:5) ? layer 2 switched off 0011 ?? layer 1 & 2 switched off 0100 reserved ?? 0101 reserved 0110 16-bit (4:4:4:2 or ttx) 2-bit overlapped 0111 reserved 1000 16-bit (4:4:4:2 or ttx) 16-bit (4:4:4:2 or ttx) embedded 1001 8-bit 8-bit embedded 1010 16-bit (4:4:4:2 or ttx) 8-bit embedded 1011 8-bit 16-bit (4:4:4:2 or ttx) embedded 1100 16-bit (5:6:5) 16-bit (5:6:5) embedded 1101 reserved 1110 1111
sda 6000 preliminary data sheet version 2.1 display generator 10 - 38 micronas 10.7.2 startaddress of layer 1 (fbr) the start address of frame buffer 1 in the memory must be set by the controller. fbr 10.7.3 size of layer 1 (fsr) fsr bit function fb_addr (23 ? 0) startaddress of frame buffer 1 bit 23 ? 0 of a byte address. bit function height_l1 (9 ? 0) height of frame buffer 1 the height of the frame buffer can vary between 0 (height_l1 = ? 0 ? d ) and 1023 pixels (height_l1 = ? 1023 ? d ). width_l1 (10 ? 0) width of frame buffer 1 the width of the frame buffer can vary between 0 (width_l1 = ? 0 ? d ) and 2046 pixels (width_l1 = ? 2046 ? d ). 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 fb_addr(15..0) 0 - - - fb_addr(23..16) 1 0 0 - 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - width_l1(10..0) - - - - 0 - height_l1(9..0) 1 0 1 -
sda 6000 preliminary data sheet version 2.1 display generator 10 - 39 micronas 10.7.4 startaddress of layer 2 (dbr) the start address of frame buffer 2 in the memory must be set by the controller. dbr 10.7.5 size of layer 2 (dsr) dsr bit function db_addr (23 ? 0) startaddress of frame buffer 2 bit 23 ? 0 of a byte address. bit function height_l2 (9 ? 0) height of layer 2 the height of layer 2 can vary between 0 (height_l2 = ? 0 ? d ) and 1023 pixels (height_l2 = ? 1023 ? d ). width_l2 (10 ? 0) width of layer 2 the width of the layer 2 can vary between 0 (width_l2 = ? 0 ? d ) and 2046 pixels (width_l2 = ? 2046 ? d ). note: width_l2 is ignored, if layer 2 is displayed in 2-bit clut2 vector format. in this case width_l2 is set to 64. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 db_addr(15..0) 1 - - - db_addr(23..16) 1 0 0 - 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - width_l2 - - - - 1 - height_l2 1 0 1 -
sda 6000 preliminary data sheet version 2.1 display generator 10 - 40 micronas 10.7.6 display coordinates of layer 2 (dcr) this instruction is used to place layer 2 in layer 1. by these coordinates the left top corner of layer 2 is placed in relation to the top left corner of layer 1. in this sense the coordinate uly = 0/ulx = 0 is identical to the top left corner of layer 1. negative coordinates are also supported so it is also possible to move a layer 2 window from the top or left side of a layer 1 window. dcr bit function uly (10 ? 0) upper left corner y-coordinate in one ? s complement representation: ? 11111111111 ? = ?? 1023 d ? ? ? 10000000000 ? = ?? 0 d ? ? 00000000000 ? = ? +0 d ? ? ? 01111111111 ? = ? + 1023 d ? ulx (11 ? 0) upper left corner x-coordinate in one ? s complement representation: ? 111111111111 ? = ?? 2046 d ? ? ? 100000000000 ? = ?? 0 d ? ? 000000000000 ? = ? +0 d ? ? ? 011111111111 ? = ? + 2046 d ? 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - - - - ulx(11..0) 0 1 1 0 - uly(10..0)
sda 6000 preliminary data sheet version 2.1 display generator 10 - 41 micronas 10.7.7 contents of clut (clr) clr instruction allows the contents of the clut1 and clut2 to be set. clr 10.7.8 clipping coordinates (cur and cbr) these gais are used to set clipping coordinates for memory transfers. the clipping coordinates describe a rectangle area in the destination memory area. during a memory transfer these ? clipped ? memory areas are excluded from the transfer. the cur instruction is used to set the clipping start address. the cbr instruction is used to set the width and height of the clipping area in amounts of pixels. a width of ? 0 ? means that no clipping is processed, a width of ? 1 ? means the clipping area has the width of 1 pixel, ? . a height of ? 0 ? means, that no clipping is processed, a height of ? 1 ? means the clipping area has the height of 1 line, ? . next to the start address, height and width a clipping offset must be given for clipping. for a rectangle clipping area the sum of this clipping offset and the clipping width must be the same as the sum of the destination area width and the destination offset. otherwise the clipping area will be a parallelogram, not a rectangle. within instruction tar it is decided whether the clipping area is inverted or non inverted. thus the outside region of the defined rectangle can be used for clipping as well as the inside region. please also refer to chapter 10.5.2 . bit function clut_ addr (8 ? 0) clut address bits 7 ? 0 are clut vectors of either clut1 or clut2. bit 8 selects the clut: 0: clut1 (256 ? 16 bit) 1: clut2 (256 ? 14 bit) clut_ content (15 ? 0) contents to be written to one of the look up tables addressed by the clut vector defined above. for clut1 all the 16 bits are used, for clut2 only bits 13 ? 0 are used. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 clut_content(15..0) 0 - - clut_addr(8..0) 1 1 1 -
sda 6000 preliminary data sheet version 2.1 display generator 10 - 42 micronas cur cbr bit function c_offset (3 ? 0) clipping offset (bit3 ? 0) the msbs of c_offset are defined by instruction cbr clipping _addr (23 ? 0) beginning of the clipping area bit 23 ? 0 of a byte address. bit function height_ clip (9 ? 0) height of the clipping area the height of the clipping area can vary between 0 (height_clip = ? 0 d ? ) and 1023 pixels (height_clip = ? 1023 d ? ). c_offset (10 ? 4) clipping offset (bit 10 ? 4) the lsbs of c_offset are defined by instruction cur. width_ clip (10 ? 0) width of the clipping area the width of the clipping area can vary between 0 (width_clip = ? 0 d ? ) and 2046 pixels (width_clip = ? 2046 d ? ). 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 clipping_addr(15..0) 0 clipping_addr(23..16) 0 0 0 c_offset(3..0) 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 width_clip(10..0) c_offset(8..4) 0 c_offset (10..9) 0 0 1 height_clip(9..0)
sda 6000 preliminary data sheet version 2.1 display generator 10 - 43 micronas 10.7.9 source descriptor for data transfer (sdr) this instruction defines the beginning of the memory area to be read and transferred. sdr this instruction defines the beginning of the destination memory area. ddr bit function go must be set to ? 1 ? if ga is to start memory transfer after executing this ga-instruction. otherwise this bit must be set to ? 0 ? . s_addr (23 ? 0) start address of memory area to be transferred. bit 23 ? 0 of a byte address. bit function go must be set to ? 1 ? if ga is to start memory transfer after executing this ga-instruction. otherwise this bit must be set to ? 0 ? . d_addr (23 ? 0) beginning of the destination memory area bit 23 ? 0 of a byte address. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 s_addr(15..0) 1 - - - s_addr(23..16) 0 0 0 go 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 d_addr(15..0) 1 - - - d_addr(23..16) 0 0 1 go
sda 6000 preliminary data sheet version 2.1 display generator 10 - 44 micronas 10.7.10 source size of transferred memory area (tsr) this register contains different information depending on transfer mode. the size of transferred memory is described by width and height of the source of the transfer area. please also refer to chapter 10.5.2 . tsr bit function go must be set to ? 1 ? if ga is to start memory transfer after executing this ga-instruction. otherwise this bit must be set to ? 0 ? . width_in (10 ? 0) width of the transferred area in count of pixels. width_in = ? 0 ? : no transfer will be executed. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - width_in(10..0) - - - - 0 - - - - - - - - - - - 0 1 0 go
sda 6000 preliminary data sheet version 2.1 display generator 10 - 45 micronas 10.7.11 destination size of transferred memory area (tdr) tdr bit function go must be set to ? 1 ? if ga is to start memory transfer after executing this ga-instruction. otherwise this bit must be set to ? 0 ? . height_ out (9 ? 0) height of the transferred area in count of pixels height_out = ? 0 ? : no transfer will be executed. width_ out (10 ? 0) width of the transferred area in count of pixels width_out = ? 0 ? : no transfer will be executed. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - width_out(10..0) - - - - 0 - height_out(9..0) 0 1 1 go
sda 6000 preliminary data sheet version 2.1 display generator 10 - 46 micronas 10.7.12 offset of transferred memory area (tor) this instruction defines the offset value for rectangle memory transfers. tor bit function go must be set to ? 1 ? if ga is to start memory transfer after executing this ga-instruction. otherwise this bit must be set to ? 0 ? . s_offset (10 ? 0) source offset value for non linear transfer for more information about s_offset refer to chapter 10.5.2 . d_offset (10 ? 0) destination offset value for non linear transfer for more information about d_offset refer to chapter 10.5.2 . 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - s_offset(10..0) - - - - 1 d_offset(10..0) 0 1 0 go
sda 6000 preliminary data sheet version 2.1 display generator 10 - 47 micronas 10.7.13 attributes of transfer (tar) this instruction defines the transfer mode. tar table 10-7 bit function go must be set to ? 1 ? if ga is to start memory transfer after executing this ga-instruction. otherwise this bit must be set to ? 0 ? . tqh quadruple height during transfer ? 0 ? : normal height is selected. ? 1 ? the memory transfer is stretched in vertical direction on the output side. un underline on/off 0: underline is switched off. 1: the last line (independent from ? tdh ? ) in the destination area is filled with a constant clut1 input (vector 0 of clut1) instead of the source bitmap input. cl (1 ? 0) clipping on/off 00: clipping is switched off. 01: reserved. 10: clipping is switched on. pixels within the clipping area will be affected. 11: clipping is switched on. pixels outside the clipping area will be affected. trm transparency mode for transfer ? 0 ? : the complete area defined by instruction sdr and tdr is written to the destination. ? 1 ? : only these (4:4:4:2) pixels are written to the destination area, for which bit tr1 = ? 0 ? . note: this bit is only relevant for 16-bit (4:4:4:2) rgb output formats please also refer to chapter 10.5.1 . 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 un trm tmode(4..0) it tdw tdh fla(1..0) - tqh cl(1..0) 1 - - - - - - - - - - - 0 1 1 go
sda 6000 preliminary data sheet version 2.1 display generator 10 - 48 micronas tmode (4 ? 0) transfer mode this mode is used to decide which transfer mode should be used. with this bit it is decided which input and which output format is used for transformation. for detailed information of the register settings please refer to chapter 10.5.1 it italic this bit is used in transfer modes if 16-bit (4:4:4:2) rgb output mode is selected. ? 0 ? : italic is switched off. ? 1 ? : italic mode is enabled. tdw double width during transfer ? 0 ? : normal width is selected. ? 1 ? : the memory transfer is stretched in horizontal direction on the output side. tdh double height during transfer ? 0 ? : normal height is selected. ? 1 ? the memory transfer is stretched in vertical direction on the output side. tqh must be set to ? 0 ? . fla(1 ? 0) flash definition this bit is used in transfer modes if output mode is in 16-bit (4:4:4:2) format for ttx. this bit is used to replace one of the 16 output bits. please refer to chapter 10.5.1 . bits flash (1 ? 0) describe the flash phase for memory transfer modes: ? 00 ? : slow rate (1 hz) ? 01 ? : fast rate flash (2 hz) phase 1 ? 10 ? : fast rate flash (2 hz) phase 2 ? 11 ? : fast rate flash (2 hz) phase 3 table 10-7 (cont ? d) bit function
sda 6000 preliminary data sheet version 2.1 display generator 10 - 50 micronas
d/a converter
sda 6000 preliminary data sheet version 2.1 d/a converter 11 - 3 micronas 11 d/a converter m2 uses a 3 ? 6-bit voltage d/a converter to generate analog rgb output signals with a nominal amplitude of 0.7 v (also available: 0.5 v, 1.0 v and 1.2 v) peak to peak. two different modes are available in order to allow the reduction of power consumption for applications which require a lower rgb bandwidth.
sda 6000 preliminary data sheet version 2.1 d/a converter 11 - 4 micronas 11.1 register description daccon reset value: 0005 h bit function rgbgain (1 ? 0) gain adjustment of rgb converter. the user can change the output gain of the dac. 00: 0.5 v 01: 0.7 v 10: 1.0 v 11: 1.2 v bwc bandwidth control 0: the effective bandwidth of the dac is set to 50 mhz 1: the effective bandwidth of the dac is set to 32 mhz. this reduces the current consumption of analog supply. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw - - - - - - - - - - - - - bwc rgbgain (1..0)
sda 6000 preliminary data sheet version 2.1 d/a converter 11 - 6 micronas
slicer and acquisition
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 3 micronas 12 slicer and acquisition
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 4 micronas 12.1 general function m2 provides a full digital slicer including digital h- and v-sync separation and digital sync processing. the acquisition interface is capable to process on all known data services starting from line 6 to line 23 for tv (teletext, vps, cc, g+, wss) as well as any full channel services. four different framing codes (two of them programmable from field to field) are available for each field. digital signal processing algorithms are applied to compensate various disturbance mechanisms. these are:  noise measurement and compensation.  attenuation measurement and compensation.  group delay measurement and compensation. note: thus, m2 is optimized for precise data clock recovery and error free reception of data widely unaffected from noise and the currently valid channel characteristics. two slicers with separated a/d converters and separated cvbs inputs are implemented. the first one is a full service slicer. the second one is a slicer which supports only the capturing of wss data. both cvbs inputs contain an on-chip clamping circuit. the integrated a/d converters are 7 bit video converters running at the internal frequency of 33.33 mhz. the sliced data is synchronized to the frequency of the clock-run-in of the actual data service and to the framing code of the data stream, framing code checked and written to a programmable vbi buffer in the external memory. after line 23 is received an interrupt can be given to the microcontroller. the microcontroller starts to process the data of this buffer. that means, the data is error checked by software and stored in the memory in the appropriate data base format. to improve the signal quality the slicer control logic generates horizontal and vertical windows in which the reception of the framing code is allowed. the framing code can be programmed for each line individually, so that in each line a different service can be received. for vps and wss the framing code is hardwired. in a special mode the framing code can be bypassed, so that all incoming data will be stored in the vbi buffer. the framing code check can then be made by software. all following acquisition tasks are performed by the internal controller, so in principal the data of every data service can be acquired.
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 5 micronas 12.2 slicer architecture the slicer is composed of five main blocks:  the full service slicer (slicer 1)  the wss only slicer (slicer 2)  the h/v synchronization for full service slicer (sync 1)  the h/v synchronization for wss only slicer (sync 2)  the acquisition interface
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 6 micronas figure 12-1 block diagram of digital slicer and acquisition interface ueb11191 d-pll separation data slicer 2 (wss only slicer) sync 2 h-pll timing sync h/v + sep. cvbs2 hs2_ir vs2_ir sync 1 sync timing sep. + h/v h-pll cc_ir l23_ir hs1_ir vs1_ir acquisition interface (full service slicer) slicer 1 & s/p converter fc-check address generation buffer parameter to/from memory d-pll separation data compen. noise group-d. attenua. measur. group-d. attenua. noise cvbs1
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 7 micronas 12.2.1 distortion processing for the full service slicer the digital bit stream is applied to a circuitry which corrects transmission distortion. in order to apply the correct counter-measures, a signal evaluation is done in parallel. this measurement device can detect the following distortions. noise the noise measurement unit incorporates two different algorithms. both algorithm are using the value between two equalizing pulses which corresponds to the black level. as the black level is known to the system a window is placed between two equalizing pulses of line four. the first algorithm compares successive samples inside a window placed in line 4. the difference between this samples is measured and a flag is set as soon as this difference over several tv lines is greater than a specified value. this algorithm is able to detect higher frequency noise (e.g. with noise). the second algorithm measures the difference between the black value and the actual sampled value inside this window. as soon as this difference over several tv lines is greater than a specified value a second flag is set. this algorithm is sensitive against low frequency noise as it is known from co- channel distortion. both flags can be used to optimize the correcting circuit characteristic in order to achieve best reception performance. frequency attenuation during signal transmission the cvbs can be attenuated severely. this attenuation normally is frequency depending. that means that the higher the frequency the stronger the attenuation. as the clock-run-in (from now on cri) for teletext represents the highest possible frequency (3.5 mhz) it can be used to measure the attenuation. as only strong negative attenuation causes problems during data slicing a flag is needed to notify highly negative attenuation. if this flag is set a special peaking filter is switched on in the data- path. group delay quite often the data stream is corrupted because of group delay distortion introduced by the transmission channel. the teletext framing code (e4 h ) is used as a reference for measurement. the delay of the edges inside this code can be used to measure the group delay distortion. the measurement is done every teletext line and filtered over several lines. it can be detected whether the signal has positive, negative or no group delay distortions. two flags are set accordingly. by means of these two flags an allpass contained in the correcting circuit is configured to compensate the positive or negative group delays. all of the above filters ca be individually disabled, forced or set to an automatic mode via control registers. note: slicer 2 does not have any compensation circuits.
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 8 micronas 12.2.2 data separation parallel to the signal analyses and distortion compensation a filter is used to calculate the slicing level. the slicing level is the mean-value of the cri. as the teletext is coded using the nrz format, the slicing level can not be calculated outside the cri and is therefore frozen after cri. using this slicing level the data is separated from the digital cvbs signal. the result is a stream of zeros and ones. in order to find the logical zeros and ones which have been transmitted, the data clock needs to be recovered as well. therefore a digital data pll (d-pll) is synchronized to the data clock during cri using the transitions in the sliced data stream. for tv-mode this d-pll is also frozen after cri, during vcr-mode it is tuned throughout the line using a slow time constant. timing informations for freezing the slicing level, stopping the d-pll and other actions are generated by the timing circuit. it generates all control signals which are dependent on the data start. in order to improve the reception performance the actual measured slicing level for each line is stored in the vbi-buffer. using this slicing level the user is able to average the value over several fields for each data line by means of software filtering. if the averaged value becomes stable this value can be used for slicing instead of the internally calculated slicing level (for further information see ram-register description). for data separation the wss slicer (slicer 2) uses the same algorithms as the full service slicer.
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 9 micronas 12.3 h/v-synchronization slicer and acquisition interface need many signals synchronized to the incoming cvbs (e.g. line number, field or line start). therefore a sync slicing level is calculated and the sync signal is sliced from the filtered digital cvbs signal. using digital integration vertical and horizontal sync pulses are separated. the horizontal pulses are fed into a digital h- pll which has flywheel functionality. the h-pll includes a counter which is used to generate all the necessary horizontal control signals. the vertical sync is used to synchronize the line counter from which the vertical control signals are derived. the synchronization block includes a watchdog which keeps control of the actual lock condition of the h-pll.the watchdog can produce an interrupt (cc_ir) if synchronization has been lost. it could therefore be an indication for a channel change or missing input signal. note: this h/v synchronization for the slicer 2 uses the same algorithms as described above.
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 10 micronas 12.4 acquisition interface the acquisition interface manages the data transfer between both slicers and memory. first of all a byte synchronization is performed (fc-check). following this, the data is paralleled and shifted into memory as 16 bit words. in the other direction parameters are loaded from memory to the slicer. after every vertical sync, parameters needed for the field are downloaded and after every horizontal sync line parameters are downloaded. the parameters are used for slicer configuration. the data acquisition supports several features. the fc-checker is able to handle four different framing codes for one field. two of these framing codes are programmable and could therefore be changed from field to field. the acquisition can be switched from normal mode (line 6 to 23) to full channel mode (line 6 to end of field). 12.4.1 fc-check there are four fc ? s which are compared to the incoming signal. the first one is 8-bit wide and is loaded down with the field parameters. the second one is 16-bit wide and fixed to the fc of vps. the third one is also 16-bit wide, but can be loaded with the field parameters. if the third one is used, the user can specify not only the fc but also a don ? t- care mask. the fourth fc is reserved for wss. the actual fc can be changed line by line. fc1 this fc should be used for all services with 8-bit framing codes (e.g. for ttx). the actual framing code is loaded down each field. the check can be done without any error tolerance or with a one bit error tolerance. note: if fc1 = e4 h this pattern is used as a reference for group delay measurement. fcvps this fc is fixed to that of vps. only an error free signal will enable the reception of the vps data line. note: if vps should be sliced in field 1 and ttx in field 2 the appropriate line parameters for line 16 have to be dynamically changed from field to field. fc3 this 16-bit framing code is loaded with the field parameters as well as a don ? t care mask. the incoming signal is compared to both, framing code and don ? t care mask. further reception is enabled if all bits, which are not don ? t care, match the incoming data stream.
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 11 micronas fcwss this fc is fixed to that of wss. a special algorithm makes sure that the wss-fc is detected even if the cvbs signal is coming from a video tape. no fc-check if fc-check is disabled, the data recording is triggered by the data start recognition. in this case the software needs to do the byte synchronization. fc-check select there is a two bit line parameter called fcsel. with this parameter the user will be able to select which fc-check is used for the actual line. if norm is set to wss the wss fccheck is used independently of fcsel. 12.4.2 interrupts some events which occur inside the slicer, the sync separation or the acquisition interface can be used to trigger an interrupt. they are summarized in register acqisn. the hardware sets the associated interrupt flag which must be manually reset by sw before the next interrupt can be accepted. all acq interrupts are bundled into one interrupt which is fed to the acq-interrupt node (acqic) of the controller. 12.4.3 vbi buffer and memory organization slicer and acquisition interface need parameters for configuration and they produce status information for the cpu. some of these parameters and status bits are constant for a field. those parameters are called field parameters. they are downloaded after the vertical sync of slicer 1. if the synchronization of slicer 1 is missing the vertical sync from slicer 2 is used to initialize the parameter download. other parameters and status bits may change from line to line (e.g. data service dependent values). those parameters are called line parameters. they are downloaded after each horizontal sync. the start address of the vbi (vbi = vertical blanking interval) buffer can be configured with special function register ? strvbi ? . 32 16-bit words have to be reserved for every sliced data line. if 18 (in full channel mode 350) lines of data have been sent to memory no further acquisition takes place until the next vertical pulse appears and the h-pll is still locked. that means if at least 1176 bytes (22424 bytes in full channel mode) are reserved for the vbi buffer no vbi overflow is possible. the acquisition can be started and stopped by the controller using bit ? acqon ? of register strvbi. the acquisition is stopped as soon as this bit changed to ? 0 ? . if the bit is changed back to ? 1 ? switching on of the acquisition is synchronized to the next v-pulse. the start address (bit 13 ? 0 of
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 12 micronas register strvbi) of the vbi buffer should only be changed if the acquisition is switched off. figure 12-2 vbi buffer: general structure ued11192 15 byte 1 byte 0 0 field parameters acqfp0 send to slicer field parameters field parameters empty empty sliced wss data (slicer 2) sliced wss data (slicer 2) sliced wss data (slicer 2) sliced wss data (slicer 2) sliced wss data (slicer 2) sliced wss data (slicer 2) field status information from both slicers field status information from both slicers line parameters for slicer 1 line parameters for slicer 1 line status 1 (of line 6) data byte 0 data byte 1 data byte 3 data byte 2 data byte 5 data byte 4 empty empty empty empty empty empty line parameters for slicer 1 line parameters for slicer 1 line status 1 (of line 7) data data data data data data acqfp1 acqfp2 after v-sync strvbi acqfp3 acqfp4 acqfp5 acqfp6 acqfp7 acqfp8 acqfp9 acqfp10 write to memory after v-sync acqlp0 acqlp1 send to slicer after v-sync vbi start line 6 acqlp4 send to memory after detecting a fc (if no fc has been detected after fcwin went inactive) last information for line 6 after h-sync acqlp1 acqlp0 start line 7 send to slicer vbi acqlp4 and so on 32 16 bit words send to memory (if no fc has been detected after fcwin went inactive) after detecting a fc 87 acqlp2 acqlp3 line parameters for slicer 1 line parameters for slicer 1 acqlp5 acqlp2 acqlp3 line status 2 (of line 6) line parameters for slicer 1 line parameters for slicer 1
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 13 micronas 12.5 register description the acquisition interface has only two sfr registers. the line and field parameters are stored in the ram (ram registers). they have to be initialized by software before starting the acquisition. special function registers: strvbi reset value: 0400 h acqisn reset value: 0000 h bit function acqon enable acquisition 0: the acq interface does not access memory (immediately inactive) 1: the acq interface is active and writes data to memory (switching on is synchronous to v) vbiadr (23 ? 10) define the 14 msb ? s of the start address of the vbi buffer. the vbi buffer location can be aligned with any 1 kbyte memory segment. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 vbiadr(23..10) acq on 0 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw rw rw rw rw rw rw rw 0 0 0 cc_ie 0 cc_ir l23_ ie l23_ ir hs2_ ie hs2_ ir vs2_ ie vs2_ ir hs1_ ie hs1_ ir vs1_ ie vs1_ ir
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 14 micronas bit function vs1_ir vs interrupt . the vertical sync impulse can be used to have field synchronization for the software. (vs of slicer 1 is used). 0: no request pending. 1: this source has raised an interrupt request. vs1_ie interrupt enable bit 0: disables the interrupt. 1: enables the interrupt. hs1_ir hs interrupt . the horizontal sync impulse can be used to implement a software line counter. (hs of slicer 1 is used). 0: no request pending. 1: this source has raised an interrupt request. hs1_ie interrupt enable bit 0: disables the interrupt. 1: enables the interrupt. vs2_ir vs interrupt . the vertical sync impulse can be used to have field synchronization for the software. (vs of slicer 2 is used). 0: no request pending. 1: this source has raised an interrupt request. vs2_ie interrupt enable bit 0: disables the interrupt. 1: enables the interrupt. hs2_ir hs interrupt . the horizontal sync impulse can be used to implement a software line counter. (hs of slicer 2 is used). 0: no request pending. 1: this source has raised an interrupt request. hs2_ie interrupt enable bit 0: disables the interrupt. 1: enables the interrupt. l23_ir line 23 interrupt .tells the controller that line 23 of the vbi is sliced (slicer 1 is used). 0: no request pending. 1: this source has raised an interrupt request. l23_ie interrupt enable bit 0: disables the interrupt. 1: enables the interrupt.
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 15 micronas note: the interrupt request flags of the acq interrupt subnode have to be cleared by software within the interrupt service routine. 12.5.1 ram registers field parameters all field parameters are updated once in a field. this means that the status information written from the acquisition interface to the memory at that time only represents a snapshot of the status. hardware ensures that field parameters are updated even if only one of the two cvbs signals has a valid sync timing. so it is assured that even if cvbs1 is not available data of cvbs2 still can be sliced. acqfp0 reset value: xxxx h acqfp1 reset value: xxxx h cc_ir channel change indicator the h-pll has lost the synchronization. (slicer 1 is used). 0: no request pending. 1: this source has raised an interrupt request. note: also refer to status bits stab1 or vdok1 cc_ie interrupt enable bit 0: disables the interrupt. 1: enables the interrupt. bit function fc3 (15 ? 0) framing code 3 bit 15: first received bit of fc. bit 0: last received bit of fc. bit function 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 fc3(15..0)
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 16 micronas bit function fc3mask (15 ? 0) mask for framing code 3 bit 15:mask for first received bit of fc. bit 0: mask for last received bit of fc. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 fc3mask(15..0)
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 17 micronas acqfp2 reset value: xxxx h bit function fc1 (7 ? 0) framing code 1 bit 7: first received bit of fc bit 0: last received bit of fc agdon automatic group delay compensation 0: automatic compensation off 1: automatic compensation on (automatic: measurement depending compensation) afron automatic frequency depending attenuation compensation 0: automatic compensation off 1: automatic compensation on (automatic: measurement depending compensation) anoon automatic noise compensation 0: automatic compensation off 1: automatic compensation on (automatic: measurement depending compensation) full 0: full channel mode off 1: full channel mode on note: don ? t forget to reserve enough memory for the vbi buffer and to initialized the appropriate line parameters. 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 fc1(7..0) agd on afr on ano om 0 0 0 0 full
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 18 micronas acqfp3 reset value: xxxx h acqfp4 reset value: xxxx h bit function wss2ok 0: no new wss data from slicer 2 is available 1: new wss data from slicer 2 is available (written to memory by acq-interface) wss2_ack 0: wss data from slicer 2 are the same as in last slicer 1 field 1: new wss data from slicer 2 received wss2_ data (83 ? 80) 4 bits of sliced data of slicer 2 (wws2_data(83) = first received bit) (written to memory by acq-interface) note: see also acqfp4 t0 acqfp8 bit function wss2_ data (79 ? 64) 16 bits of sliced data of slicer 2 (written to memory by acq-interface). note: see also acqfp3 and acqfp5 to acqfp8 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 wss2 ok wss2 _ack 0 0 0 0 0 0 wss2_data(83..80) 0 0 0 0 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 wss2_data(79..64)
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 19 micronas acqfp5 reset value: xxxx h acqfp6 reset value: xxxx h b acqfp7 reset value: xxxx h bit function wss2_ data (63 ? 48) 16 bits of sliced data of slicer 2 (written to memory by acq-interface). note: see also acqfp3, acqfp4, acqfp6 to acqfp8 bit function wss2_ data (47 ? 32) 16 bits of sliced data of slicer 2 (written to memory by acq-interface). note: see also acqfp3 to acqfp5 and acqfp7 to acqfp8 bit function wss2_ data (31 ? 16) 16 bits of sliced data of slicer 2 (written to memory by acq-interface). note: see also acqfp3 to acqfp6 and acqfp8 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 wss2_data(63..48) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 wss2_data(47..32) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 wss2_data(31..16)
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 20 micronas acqfp8 reset value: xxxx h acqfp9 reset value: xxxx h bit function wss2_ data (15 ? 0) 16 bits of sliced data of slicer 2 (wws2_data(0) = last received bit) (written to memory by acq-interface). note: see also acqfp3 to acqfp7 bit function stab1 (status bit) 0: h-pll of slicer 1 not locked 1: h-pll of slicer 1 locked (written to memory by acq-interface) vok1 (status bit) vertical sync watchdog of slicer 1 0: v-sync of slicer 1 not stable 1: v-sync of slicer 1 stable (written to memory by acq-interface) field1 (status bit) 0: actual field of slicer 1 is field 1 1: actual field of slicer 1 is field 2 (written to memory by acq-interface) freattf (status bit) frequency depending attenuation measurement (field indicator) high frequency cvbs1components (around 3.5 mhz) are strongly damped (6 to 9 db) compared to lower frequency cvbs1 components 0: no frequency depending attenuation has been detected during the last field 1: for at least one text line during the last field frequency depending attenuation has been detected. (written to memory by acq-interface) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 wss2_data(15..0) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 0 0 0 stab 1 0 0 vok 1 field 1 frea ttf nois e(1) nois e(0) stab 2 grd on grd sign vok 2 field 2
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 21 micronas acqfp10 reset value: xxxx h noise (1 ? 0) (status bit) noise and co-channel detector of slicer 1 00: no noise and no co-channel-distortion has been detected. 01: no noise but co-channel-distortion has been detected. 10: noise but no co-channel-distortion has been detected. 11: strong noise has been detected. (written to memory by acq-interface) grdon (status bit) group delay detector of slicer 1 0: no group delay distortion detected 1: group delay distortion detected (written to memory by acq-interface) grdsign (status bit) 0: if group delay distortion has been detected it was positive 1: if group delay distortion has been detected it was negative (written to memory by acq-interface, cvbs input of slicer 1 is used) stab2 (status bit) 0: h-pll of slicer 2 not locked 1: h-pll of slicer 2 locked (written to memory by acq-interface) vok2 (status bit) vertical sync watchdog of slicer 2 0: v-sync of slicer 2 not stable 1: v-sync of slicer 2 stable (written to memory by acq-interface) field2 (status bit) 0: actual field of slicer 2 is field 1 1: actual field of slicer 2 is field 2 (written to memory by acq-interface) bit function leofli (11 ? 0) this value is the output of the filter of the h-pll of slicer 1 and represents the actual horizontal period of cvbs1 in 33.33 mhz clock cycles. this information can be used to measure the actual line frequency of the cvbs signal. bit function 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 0 0 0 0 leofl(11.0)
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 22 micronas line parameters note: line parameters only work on slicer 1 and have no influence on slicer 2. acqlp0 reset value: xxxx h acqlp1 reset value: xxxx h bit function dincr (15 ? 0) specifies the frequency of the d-pll of slicer 1. this parameter is used to configure the d-pll output frequency according to the service used. dincr = f data ? 2 18 / 33.33 mhz f data [mhz] dincr 6.9375 54559 5.7273 45041 5.0 39321 1.006993 7920 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 dincr(15..0) 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 0 0 0 0 0 0 0 0 accu on pllt on lowp on gdno n pfil on gdpo n fre on noi on
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 23 micronas bit function accuon accumulator on improves slicing level calculation under noisy conditions. if noise has been detected during automatic mode or if the bit noion has been set the internal slicing level calculation can be improved by setting this bit. 0: standard slicing level calculation 1: improved slicing level calculation (improvement depends also on parameter alength) plllon pll tune on if noise has been detected during automatic mode or if the bit noion has been set the data clock recovery pll can be tuned throughout the line by setting this bit. 0: pll is frozen after clock run in 1: pll is tuned throughout the line lowpon low pass on if noise has been detected during automatic mode or if the bit noion has been set a special low pass can be switched into the signal pass by setting this bit (useful if mainly high frequency noise above 3.5 mhz is present). 0: low pass is not used 1: low pass is used pfillon pre filter on if noise has been detected during automatic mode or if the bit noion has been set a second filter can be switched into the signal pass by setting this bit (also useful if mainly high frequency noise above 3.5 mhz is present). 0: low pass is not used. 1: low pass is used. gdpon 0: group delay compensation depends on agdon 1: positive group delay compensation is always on gdnon 0: group delay compensation depends on agdon 1: negative group delay compensation is always on freon 0: frequency depending attenuation compensation depends on afron 1: frequency depending attenuation compensation is always on noion 0: noise compensation depends on anoon 1: noise compensation is always on
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 24 micronas acqlp2 reset value: xxxx h bit function fc1er error tolerance of fc1 check 0: no error allowed 1: one error allowed mlength (2 ? 0) for noise suppression reasons a median filter has been introduced after the actual data separation because of oversampling successive samples could be averaged. therefore an odd number of sliced successive samples is taken and if the majority are ? 1 ? a ? 1 ? is sliced otherwise a ? 0 ? . mlength specifies how many samples are taken. mlength number of samples 000 1 001 3 010 5 011 7 100 9 101 11 110 13 111 15 alength (1 ? 0) if noise has been detected or if noiseon = 1, the output of the slicing level filter is further averaged by means of an accumulation (arithmetic averaging). alength specifies the number of slicing level filter output values used for averaging. the accumulation clock depends on clkdiv. alength number of slicing level output values used for averaging 00 2 01 4 10 8 11 16 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 fc1 er mlength(2..0) alength (1..0) fcsel(1..0) clkdiv(2..0) norm(2..0) vcr 0
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 25 micronas clkdiv the slicing level filter needs to find the dc value of the cvbs during cri. in order to do this it should suppress at least the cri frequency. as different services use different data frequencies the cri frequency will be different as well. therefore the filter characteristic needs to be shifted. this can be done by using different clocks for the filter. the filter itself shows sufficient suppression for frequencies between 0.0757 ? sl clk and 0.13 ? sl clk (sl clk is the actual filter clock and corresponds to slicer 1) clkdiv sl clk 000 1 ? f s 001 1/2 ? f s 010 1/3 ? f s 011 1/4 ? f s 100 1/5 ? f s 101 1/6 ? f s 110 1/7 ? f s 111 1/8 ? f s note: f s = 33.33 mhz norm most timing signals are closely related to the actual data service used. therefore 3 bits specify the service received in the actual line. norm service 000 txt 001 nabts 010 vps 011 wss 100 cc 101 g+ 110 reserved 111 no data service bit function
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 26 micronas acqlp3 reset value: xxxx h fcsel there are three different framing codes which can be used for each field. the framing code used for the actual line is selected with fcsel (corresponds to slicer 1). fcsel fc 00 fc1 01 fc2 10 fc3 11 no fc-check (all data are dumped to the vbi buffer) vcr this bit is used to change the behavior of the d-pll and h-pll. 0: d-pll tuning is stopped after cri; h-pll -> slow time constant 1: d-pll is tuned throughout the line; h-pll -> fast time constant bit function slss slicing level source selector the slicer allows the use of an internal calculated slicing level or an external set slicing level. 0: internal calculated slicing level is used. 1: external set slicing level is used. ssl(6 ? 0) set slicing level if the bit slss is set the slicer is using the value of ssl as slicing level instead of the internal calculated slicing level. the slicing level output in parameter msl is never the less the internal calculated value. bit function 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 slss ssl(6..0)
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 27 micronas acqlp4 reset value: xxxx h bit function freattl frequency depending attenuation measurement (line indicator) high frequency-cvbs1-components (around 3.5 mhz) are strongly damped (6 to 9 db) compared to lower frequency-cvbs1-components 0: no frequency depending attenuation has been detected for the following line 1: strong frequency depending attenuation has been detected for the following line (written to memory by acq-interface) msl(6 ? 0) measured slicing level the value represents the slicing level which has been measured for the current data line. the value can be used to calculate a better slicing level especially for noisy signals by means of software averaging algorithms. the improved slicing level can be set for the following fields by writing to parameter ssl. perrp (5 ? 0) phase error watch dog preliminary (detection of test line ccir331a or b) the value shows how often in a line the internal pll found strong phase deviations between pll and sliced data. the value can be used to detect test line ccir331a or b. this value is only preliminary as an exact result is only available at the end of each line. for the exact value see perr at acqlp5. perrp < 32? no test line. perrp > 31? test line ccir331a or b detected tlde test line detected (ccir17 or ccir18 or ccir330) 0: no test line of the above mentioned test lines has been detected 1: the following data has most likely be sliced from a test line and should therefor be ignored. fcok framing code received 0: no framing code has been detected (no new data has been written to memory) 1: the selected framing code has been detected (new data has been written to memory 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 frea ttl msl(6..0) perrp(5..0) tlde fcok
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 28 micronas acqlp5 reset value: xxxx h bit function perr (5 ? 0) phase error watch dog (detection of test line ccir331a or b) this is the exact phase error watch dog output for the current line. the value shows how often in a line the internal pll found strong phase deviations between pll and sliced data. the value can be used to detect test line ccir331a or b. perr < 32? no test line. perr > 31? test line ccir331a or b detected 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 0 0 0 0 0 0 0 0 0 0 perr(5..0)
sda 6000 preliminary data sheet version 2.1 slicer and acquisition 12 - 29 micronas 12.5.2 recommended parameter settings ttx vps wss cc g+ agdon 10000 afron 10000 anoon 11111 gdpon 00000 gdnon 00000 freon 00000 pfilon 01111 lowpon 01111 pllton 01111 accuon 01111 noion 00000 full 00000 dincr 54559 45041 39321 7864 7920 fc1er 00000 mlength 12777 alength 22222 clkdiv 00255 norm 02345 fcsel 01222 vcr 00000 fc1 228 don ? t care don ? t care don ? t care don ? t care fc3 don ? t care don ? t care don ? t care 3 1261 fc3mask don ? t care don ? t care don ? t care 65472 63488
register overview
sda 6000 preliminary data sheet version 2.1 register overview 13 - 3 micronas 13 register overview this section summarizes all sfr and esfr registers, which are implemented in m2 and explains the description format which is used in the previous chapters to describe the functionality of the sfrs. display generators and slicers are mainly programmed via ram registers which are not mentioned in this chapter, due to their variable position in the ram. ram registers are principally undefined after reset. for easy reference the registers are ordered according to two different keys:  ordered by their functional context  ordered by register address, to find the location of a specific register.
sda 6000 preliminary data sheet version 2.1 register overview 13 - 4 micronas 13.1 register description format in the respective chapters the function and the layout of the sfrs is described in a specific format which provides a number of details about the described special function register. the example below shows how to interpret these details. a register looks like this: reg_name reset value: **** h reg_name name of this register. * * * * register contents after reset. 0/1 : defined value, ? x ? : undefined after power up. bits that are set/cleared by hardware are marked with a shaded access box. r read only register. rw register can be read and written. - reserved register bit. reading such bits delivers an undefined value. if such a bit is written then only ? 0 ? is allowed. bit function bit(field) name explanation of bit(field)name description of the functions controlled by this bit(field) . 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 w r rw rw rw - - - - - - - - - write only read only std bit hw bit bitfield(2:0) rw
sda 6000 preliminary data sheet version 2.1 register overview 13 - 5 micronas 13.2 cpu general purpose registers (gprs) the gprs form the register bank with which the cpu works. this register bank may be located anywhere within the internal ram via the context pointer (cp). due to the addressing mechanism, gpr banks can only reside within the internal ram. all gprs are bit-addressable. the first 8 gprs (r7 ? r0) may also be accessed via the byte. other than with sfrs, writing to a gpr byte does not affect the other byte of the respective gpr. the respective half of the byte-accessible registers receive special names: name physical address 8-bit address description reset value r0 (cp) + 0 f0 h cpu general purpose (word) register r0 xxxx h r1 (cp) + 2 f1 h cpu general purpose (word) register r1 xxxx h r2 (cp) + 4 f2 h cpu general purpose (word) register r2 xxxx h r3 (cp) + 6 f3 h cpu general purpose (word) register r3 xxxx h r4 (cp) + 8 f4 h cpu general purpose (word) register r4 xxxx h r5 (cp) + 10 f5 h cpu general purpose (word) register r5 xxxx h r6 (cp) + 12 f6 h cpu general purpose (word) register r6 xxxx h r7 (cp) + 14 f7 h cpu general purpose (word) register r7 xxxx h r8 (cp) + 16 f8 h cpu general purpose (word) register r8 xxxx h r9 (cp) + 18 f9 h cpu general purpose (word) register r9 xxxx h r10 (cp) + 20 fa h cpu general purpose (word) register r10 xxxx h r11 (cp) + 22 fb h cpu general purpose (word) register r11 xxxx h r12 (cp) + 24 fc h cpu general purpose (word) register r12 xxxx h r13 (cp) + 26 fd h cpu general purpose (word) register r13 xxxx h r14 (cp) + 28 fe h cpu general purpose (word) register r14 xxxx h r15 (cp) + 30 ff h cpu general purpose (word) register r15 xxxx h
sda 6000 preliminary data sheet version 2.1 register overview 13 - 6 micronas name physical address 8-bit address description reset value rl0 (cp) + 0 f0 h cpu general purpose (byte) register rl0 xx h rh0 (cp) + 1 f1 h cpu general purpose (byte) register rh0 xx h rl1 (cp) + 2 f2 h cpu general purpose (byte) register rl1 xx h rh1 (cp) + 3 f3 h cpu general purpose (byte) register rh1 xx h rl2 (cp) + 4 f4 h cpu general purpose (byte) register rl2 xx h rh2 (cp) + 5 f5 h cpu general purpose (byte) register rh2 xx h rl3 (cp) + 6 f6 h cpu general purpose (byte) register rl3 xx h rh3 (cp) + 7 f7 h cpu general purpose (byte) register rh3 xx h rl4 (cp) + 8 f8 h cpu general purpose (byte) register rl4 xx h rh4 (cp) + 9 f9 h cpu general purpose (byte) register rh4 xx h rl5 (cp) + 10 fa h cpu general purpose (byte) register rl5 xx h rh5 (cp) + 11 fb h cpu general purpose (byte) register rh5 xx h rl6 (cp) + 12 fc h cpu general purpose (byte) register rl6 xx h rh6 (cp) + 13 fd h cpu general purpose (byte) register rh6 xx h rl7 (cp) + 14 fe h cpu general purpose (byte) register rl7 xx h rh7 (cp) + 15 ff h cpu general purpose (byte) register rh7 xx h
sda 6000 preliminary data sheet version 2.1 register overview 13 - 7 micronas 13.3 registers ordered by context the following table lists all sfrs which are implemented in the m2 grouped by their context. their actual address can be seen in the next chapter. table 13-1 name description physical address 8-bit address reset value ssc registers ssccon control register ffb2 h d9 h 0000 h sscbr baud rate timer reload register f0b4 h 5a h 0000 h ssctb transmit buffer register f0b0 h 58 h 0000 h sscrb receive buffer register f0b2 h 59 h 0000 h asc registers s0con control register ffb0 h d8 h 0000 h s0abstat autobaud status register f0b8 h 5c h 0000 h s0abcon autobaud control register f1b8 h dc h 0000 h s0bg baud rate timer reload register feb4 h 5a h 0000 h s0fdv fractional divider register feb6 h 5b h 0000 h s0pmw irda pulse mode and width register feaa h 55 h 0000 h s0tbuf transmit buffer register feb0 h 58 h 0000 h s0rbuf receive buffer register feb2 h 59 h 0000 h i 2 c registers iccfg 2) i 2 c configuration register e810 h -/- 0000 h iccon 2) i 2 c control register e812 h -/- 0000 h icst 2) i 2 c status register e814 h -/- 0000 h icadr 2) i 2 c address register e816 h -/- 0000 h icrtbl 2) i 2 c receive/transmit buffer (low word) e818 h -/- 0000 h icrtbh 2) i 2 c receive/transmit buffer (high word) e81a h -/- 0000 h iicpisel 2) i 2 c port input selection register e804 h -/- 0000 h watchdog timer registers wdtcon control register ffae h d7 h 000x h wdt timer register feae h 57 h 0000 h realtime clock registers
sda 6000 preliminary data sheet version 2.1 register overview 13 - 8 micronas rtccon control register f1cc h e6 h 0003 h t14rel prescaler timer reload f0d0 h 68 h 0000 h t14 prescaler timer t14 f0d2 h 69 h 0000 h rtcl count register low word f0d4 h 6a h 0000 h rtch count register high word f0d6 h 6b h 0000 h rtcrell reload register low word f0cc h 66 h 0000 h rtcrelh reload register high word f0ce h 67 h 0000 h rtcisnc rtc interrupt subnode control (1st level) f1c8 h e4 h 0000 h isnc rtc interrupt subnode control (2nd level) f1de h ef h 0000 h table 13-1 (cont ? d) name description physical address 8-bit address reset value
sda 6000 preliminary data sheet version 2.1 register overview 13 - 9 micronas general purpose timer registers (gpt1/2) t2con gpt1 timer 2 control register ff40 h a0 h 0000 h t3con gpt1 timer 3 control register ff42 h a1 h 0000 h t4con gpt1 timer 4 control register ff44 h a2 h 0000 h t5con gpt2 timer 5 control register ff46 h a3 h 0000 h t6con gpt2 timer 6 control register ff48 h a4 h 0000 h t2 gpt1 timer 2 register fe40 h 20 h 0000 h t3 gpt1 timer 3 register fe42 h 21 h 0000 h t4 gpt1 timer 4 register fe44 h 22 h 0000 h t5 gpt2 timer 5 register fe46 h 23 h 0000 h t6 gpt6 timer 2 register fe48 h 24 h 0000 h caprel gpt1 capture reload register fe4a h 25 h 0000 h adc registers addat1 adc data register for channel 1 and 2 fea0 h 50 h 0000 h addat2 adc data register for channel 3 and 4 fea2 h 51 h 0000 h adccon adc control register fea4 h 52 h 0000 h interrupt control registers t2ic timer 2 interrupt control register ff60 h b0 h 0000 h t3ic timer 3 interrupt control register ff62 h b1 h 0000 h t4ic timer 4 interrupt control register ff64 h b2 h 0000 h t5ic timer 5 interrupt control register ff66 h b3 h 0000 h t6ic timer 6 interrupt control register ff68 h b4 h 0000 h cric caprel interrupt control register ff6a h b5 h 0000 h ex0ic external interrupt control register 0 ff88 h c4 h 0000 h ex1ic external interrupt control register 1 ff8a h c5 h 0000 h ex2ic external interrupt control register 2 ff8c h c6 h 0000 h ex3ic external interrupt control register 3 ff8e h c7 h 0000 h ex4ic external interrupt control register 4 ff90 h c8 h 0000 h ex5ic external interrupt control register 5 ff92 h c9 h 0000 h ex6ic external interrupt control register 6 ff94 h ca h 0000 h table 13-1 (cont ? d) name description physical address 8-bit address reset value
sda 6000 preliminary data sheet version 2.1 register overview 13 - 10 micronas ex7ic external interrupt control register 7 ff96 h cb h 0000 h adc1ic a/d conversion interrupt control (channel 1 + 2) ff98 h cc h 0000 h adc2ic a/d conversion interrupt control (channel 3 + 4) ff9a h cd h 0000 h adwic a/d wake up interrupt f178 h bc h 0000 h ssceic ssc error interrupt control ff76 h bb h 0000 h sscric ssc receive interrupt control ff74 h ba h 0000 h ssctic ssc transmit interrupt control ff72 h b9 h 0000 h s0eic asc error interrupt control ff70 h b8 h 0000 h s0ric asc receive interrupt control ff6e h b7 h 0000 h s0tic asc transmit interrupt control ff6c h b6 h 0000 h s0tbic asc transmit buffer interrupt control f19c h ce h 0000 h abstoic asc autobaud stop interrupt control f17a h bd h 0000 h abstaic asc autobaud start interrupt control ff9e h cf h 0000 h i 2 ctic i 2 c transfer interrupt control f194 h ca h 0000 h i 2 cpic i 2 c protocol interrupt control f18c h c6 h 0000 h i 2 cteic i 2 c transmission end interrupt control f184 h c2 h 0000 h acqic acquisition-interrupt control f176 h bb h 0000 h vsdisic display-vertical-sync interrupt control f174 h ba h 0000 h hsdisic display-horizontal-sync interrupt control f172 h b9 h 0000 h gafic graphic accelerator interrupt control ff9c h ce h 0000 h rtcic realtime clock interrupt control f19e h cf h 0000 h pecclic pec link interrupt control f180 h c0 h 0000 h pec interrupt control registers pecc0 pec channel 0 control register fec0 h 60 h 0000 h pecc1 pec channel 1 control register fec2 h 61 h 0000 h pecc2 pec channel 2 control register fec4 h 62 h 0000 h pecc3 pec channel 3 control register fec6 h 63 h 0000 h pecc4 pec channel 4 control register fec8 h 64 h 0000 h table 13-1 (cont ? d) name description physical address 8-bit address reset value
sda 6000 preliminary data sheet version 2.1 register overview 13 - 11 micronas pecc5 pec channel 5 control register feca h 65 h 0000 h pecc6 pec channel 6 control register fecc h 66 h 0000 h pecc7 pec channel 7 control register fece h 67 h 0000 h pecsn0 pec segment number channel 0 register fed0 h 68 h 0000 h pecsn1 pec segment number channel 1 register fed2 h 69 h 0000 h pecsn2 pec segment number channel 2 register fed4 h 6a h 0000 h pecsn3 pec segment number channel 3 register fed6 h 6b h 0000 h pecsn4 pec segment number channel 4 register fed8 h 6c h 0000 h pecsn5 pec segment number channel 5 register feda h 6d h 0000 h pecsn6 pec segment number channel 6 register fedc h 6e h 0000 h pecsn7 pec segment number channel 7 register fede h 6f h 0000 h clisnc pec channel link interrupt subnode register ffa8 h d4 h 0000 h port registers rp0h reset configuration at port 4 (read only) f108 h 85 h xx h p2 port 2 register ffc0 h e0 h 0000 h p3 port 3 register ffc4 h e2 h 0000 h p4 port 4 register ffc8 h e4 h 0000 h p5 port 5 register ffa2 h d1 h 0000 h p6 port 6 register ffcc h e6 h 0000 h dp2 direction control register port 2 ffc2 h e1 h 0000 h dp3 direction control register port 3 ffc6 h e3 h 0000 h dp6 direction control register port 6 ffce h e7 h 0000 h odp3 open drain control register port 3 f1c6 h e3 h 0000 h odp6 open drain control register port 6 f1ce h e7 h 0000 h p5ben analog/digital input enable register port 5 f1c2 h e1 h 0000 h altsel0p6 alternate function enable register port 6 f12c h 96 h 0000 h specific control registers strvbi vbi buffer start register f1a0 h d0 h 0000 h table 13-1 (cont ? d) name description physical address 8-bit address reset value
sda 6000 preliminary data sheet version 2.1 register overview 13 - 12 micronas pxdel pixel delay register f198 h cc h 0000 h acqisn acquisition interrupt subnode register f1a2 h d1 h 0000 h gprgcrl gai instruction start register (low word) f1a4 h d2 h 0000 h gprgcrh gai instruction start register (high word) f1a6 h d3 h 0000 h dgcon display generator control fefa h 7d h 0000 h scr sync control register f1a8 h d4 h 0000 h vlr vertical line register f1aa h d5 h 0271 h bvcr begin of vertical clamping fef6 h 7b h 0001 h evcr end of vertical clamping fef8 h 7c h 0005 h hpr horizontal period register f1ac h d6 h 0855 h sdv vertical sync delay register f1ae h d7 h 0020 h sdh horizontal sync delay register f1b0 h d8 h 0020 h hcr horizontal clamping register f1b2 h d9 h 1400 h pfr pixel frequency register f1b6 h db h 00a4 h daccon rgb - dac control register f1b4 h da h 0005 h external bus interface control registers redir memory map redirection register f1ba h dd h 0000 h redir1 memory map redirection register 1 f1ca h e5 h 00ff h ebicon control register for ebi f1bc h de h 0000 h ebidir direct access register for ebi f1be h df h 0000 h ocds registers comdata communication mode data register f068 h 34 h 0000 h rwdata read/write mode data register f06a h 35 h 0000 h iosr communication mode status register f06c h 36 h 0000 h dcmpll hardware trigger range comparison lower bound f0dc h 6e h 0000 h 1) dcmplh extension of register dcmpll f0de h 6f h 0000 h 1) dcmpgl hardware trigger range comparison upper bound f0e0 h 70 h 0000 h 1) dcmpgh extension of register dcmpgl f0e2 h 71 h 0000 h 1) table 13-1 (cont ? d) name description physical address 8-bit address reset value
sda 6000 preliminary data sheet version 2.1 register overview 13 - 13 micronas dcmp0l hardware trigger equal comparison register 0 f0e4 h 72 h 0000 h 1) dcmp0h extension of register dcmp0l f0e6 h 73 h 0000 h 1) dcmp1l hardware trigger equal comparison register 1 f0e8 h 74 h 0000 h 1) dcmp1h extension of register dcmp1l f0ea h 75 h 0000 h 1) dcmp2l hardware trigger equal comparison register 2 f0ec h 76 h 0000 h 1) dcmp2h extension of register dcmp2l f0ee h 77 h 0000 h 1) dtrevt hardware trigger event control f0f0 h 78 h 0000 h 1) dswevt software trigger event control f0f4 h 7a h 0000 h 1) dexevt external trigger event control f0f8 h 7c h 0000 h 1) dbgsr debug status register f0fc h 7e h 0000 h 1) system & cpu registers tfr trap flag register ffac h d6 h 0000 h addrsel1 address select register 1 fe18 h 0c h 0000 h addrsel2 address select register 2 fe1a h 0d h 0000 h addrsel3 address select register 3 fe1c h 0e h 0000 h addrsel4 address select register 4 fe1e h 0f h 0000 h buscon0 bus configuration register 0 ff0c h 86 h 0000 h buscon1 bus configuration register 1 ff14 h 8a h 0000 h buscon2 bus configuration register 2 ff16 h 8b h 0000 h buscon3 bus configuration register 3 ff18 h 8c h 0000 h buscon4 bus configuration register 4 ff1a h 8d h 0000 h syscon cpu system configuration register ff12 h 89 h 0400 h syscon1 cpu system configuration register 1 f1dc h ee h 0000 h syscon2 cpu system configuration register 2 f1d0 h e8 h 0000 h xadrs1 external address select register 1 f014 h 0a h 0000 h xadrs2 external address select register 2 f016 h 0b h 0000 h xadrs3 external address select register 3 f018 h 0c h 0000 h table 13-1 (cont ? d) name description physical address 8-bit address reset value
sda 6000 preliminary data sheet version 2.1 register overview 13 - 14 micronas xadrs4 external address select register 4 f01a h 0d h 0000 h xadrs5 external address select register 5 f01c h 0e h 0000 h xadrs6 external address select register 6 f01e h 0f h 0000 h xbcon1 xbus control register 1 f114 h 8a h 0000 h xbcon2 xbus control register 2 f116 h 8b h 0000 h xbcon3 xbus control register 3 f118 h 8c h 0000 h xbcon4 xbus control register 4 f11a h 8d h 0000 h xbcon5 xbus control register 5 f11c h 8e h 0000 h xbcon6 xbus control register 6 f11e h 8f h 0000 h dpp0 cpu data page pointer 0 (10bits) fe00 h 00 h 0000 h dpp1 cpu data page pointer 1 (10bits) fe02 h 01 h 0001 h dpp2 cpu data page pointer 2 (10bits) fe04 h 02 h 0002 h dpp3 cpu data page pointer 3 (10bits) fe06 h 03 h 0003 h mdh cpu multiply divide control register high word fe0c h 06 h 0000 h mdl cpu multiply divide control register low word fe0e h 07 h 0000 h mdc cpu multiply divide control register ff0e h 87 h 0000 h psw cpu program status word ff10 h 88 h 0000 h stkun cpu stack underflow pointer register fe16 h 0b h 0000 h stkov cpu stack overflow pointer register fe14 h 0a h 0000 h sp cpu system stack pointer fe12 h 09 h fc00 h cp cpu context pointer fe10 h 08 h fc00 h csp cpu code segment control register fe08 h 04 h 0000 h scuslc security level command register f0c0 h 60 h 0000 h scusls security level status register f0c2 h 61 h 0000 h zeros constant value 0 ? s register (read only) ff1c h 8e h 0000 h ones constant value 1 ? s register (read only) ff1e h 8f h ffff h xpercon x-peripheral control register f024 h 12 h 0000 h exisel alternative external interrupt selection f1da h ed h 0000 h table 13-1 (cont ? d) name description physical address 8-bit address reset value
sda 6000 preliminary data sheet version 2.1 register overview 13 - 15 micronas exicon external interrupt control f1c0 h e0 h 0000 h osccon oscillator pad control register f1c4 h e2 h 0001 h idmanuf manufacture id f07e h 3f h xxxx h idchip chip id f07c h 3e h xxxx h tm_lo hardware testmode register low fefc h 7e h 0000 h tm_hi hardware testmode register high fefe h 7f h 0000 h focon scu register (no function within m2) ffaa h d5 h 0000 h syscon3 scu register (no function within m2) f1d4 h ea h 0000 h 1) ocds related registers that are not reset during a controller reset. 2) no 8-bit addresses provided for xbus registers. table 13-1 (cont ? d) name description physical address 8-bit address reset value
sda 6000 preliminary data sheet version 2.1 register overview 13 - 16 micronas 13.4 registers ordered by address the following tables summarize the register symbols and their ? short addresses ? . the physical address can be calculated by multiplying the short address by 2 and adding that value to fe00 h for the sfr register area and adding f000 h for the extended sfr area. bit-addressable registers are highlighted in gray.
sda 6000 preliminary data sheet version 2.1 register overview 13 - 17 micronas 13.4.1 registers in sfr area address + 00 h + 01 h + 02 h + 03 h + 04 h + 05 h + 06 h + 07 h 00 h dpp0 dpp1 dpp2 dpp3 csp reserved mdh mdl 08 h cp sp stkov stkun addrsel1 addrsel2 addrsel3 addrsel4 10 h - - - - - - - - 18 h -------- 20 h t2 t3 t4 t5 t6 caprel reserved - 28 h ---- - - - - 30 h -------- 38 h -------- 40 h -------- 48 h -------- 50 h addat1 addat2 adccon - - s0pmw - wdt 58 h sotbuf sorbuf s0bg s0fdv s0abstat - - - 60 h pecc0 pecc1 pecc2 pecc3 pecc4 pecc5 pecc6 pecc7 68 h pecsn0 pecsn1 pecsn2 pecsn3 pecsn4 pecsn5 pecsn6 pecsn7 70 h -------- 78 h - - - bvcr evcr dgcon tm_lo tm_hi 80 h - - - - - - buscon0 mdc 88 h psw syscon buscon1 buscon2 buscon3 buscon4 zeros ones 90 h - - - - - - - - 98 h - - - - - - - - a0 h t2con t3con t4con t5con t6con - - - a8 h - - - - - - - - b0 h t2ic t3ic t4ic t5ic t6ic cric s0tic s0ric b8 h s0eic ssctic sscric ssceic - abstoic - - c0 h - - - - cc0ic cc1ic cc2ic cc3ic c8 h cc4ic cc5ic cc6ic cc7ic adc1ic adc2ic gafic abstaic d0 h - p5 - - clisnc focon tfr wdtcon d8 h s0con ssccon - - s0abcon reserved - - e0 h p2 dp2 p3 dp3 p4 - p6 dp6 e8 h - - - - - - - - f0 h r0 r1 r2 r3 r4 r5 r6 r7 f8 h r8 r9 r10 r11 r12 r13 r14 r15
sda 6000 preliminary data sheet version 2.1 register overview 13 - 18 micronas 13.4.2 registers in esfr area address + 00 h + 01 h + 02 h + 03 h + 04 h + 05 h + 06 h + 07 h 00 h - - - - - - cpuid - 08 h - - xadrs1 xadrs2 xadrs3 xadrs4 xadrs5 xadrs6 10 h --xpercon----- 18 h ------reservedreserved 20 h reservedreservedreserved----- 28 h ---- - - -- 30 h ----comdatarwdataiosr- 38 h idrt idscu - idmem2 idprog idmem idchip idmanuf 40 h -------- 48 h -------- 50 h -------- 58 h ssctb sscrb sscbr reserved reserved - - - 60 h scuslc scusls - - reserved - rtcrell rtcrelh 68 h t14rel t14 rtcl rtch reserved reserved dcmpll dcmplh 70 h dcmpgl dcmpgh dcmp0l dcmp0h dcmp1l dcmp1h dcmp2l dcmp2h 78 h dtrevt - dswevt - dexevt - dbgsr - 80 h - - - - rp0h - - - 88 h - - xbcon1 xbcon2 xbcon3 xbcon4 xbcon5 xbcon6 90 h - - - - - - altsel0p6 - 98 h - - - - - - - - a0 h - - - - - - - - a8 h - - - - - - - - b0 h - - - - - - - - b8 h - hsdisic vsdisic acqic adwic - - - c0 h pecclic - i 2 cteic - - - i 2 cpic - c8 h - - i 2 ctic - pxdel - s0tbic rtcic d0 h strvbi acqisn gprgcrl gprgcrh scr vlr hpr sdv d8 h sdh hcr daccon pfr reserved redir ebicon ebidir e0 h exicon p5ben osccon odp3 rtcisnc redir1 rtccon odp6 e8 h syscon2 - syscon3 - - exisel syscon1 isnc f0 h r0 r1 r2 r3 r4 r5 r6 r7 f8 h r8 r9 r10 r11 r12 r13 r14 r15
sda 6000 preliminary data sheet version 2.1 register overview 13 - 20 micronas
elelctrical characteristics
sda 6000 preliminary data sheet version 2.1 electrical characteristics 14 - 3 micronas 14 electrical characteristics
sda 6000 preliminary data sheet version 2.1 electrical characteristics 14 - 4 micronas 14.1 absolute maximum ratings note: the maximum ratings may not be exceeded under any circumstances, not even momentarily and individually, as permanent damage to the ic will result. table 14-1 ambient temperature t a = 0 ? c ? +70 ? c parameter symbol limit values unit test condition min. max. supply voltage 3.3 v v dd33 1-7 ? 4.0 v ? supply voltage 2.5 v v dd25 1-2 ? 3.0 v ? analog supply voltage v dda 1-4 ? 3.0 v ? storage temperature t stg ? 20 125 ? c ? electrostatic discharge ? 2000 ? v 100 pf, 1.5 k hbm
sda 6000 preliminary data sheet version 2.1 electrical characteristics 14 - 5 micronas 14.2 operating range note: in the operating range, the functions given in the circuit description are fulfilled. table 14-2 operating range parameter symbol limit values unit test condition min. max. ambient temperature t a 070 ? c ? supply voltage 3.3 v v dd33 1-7 3.1 3.6 v ? supply voltage 2.5 v v dd25 1-2 2.25 2.75 v ? analog supply voltage v dda 1-4 2.25 2.75 v ? total power consumption p total ? 1.5 w ?
sda 6000 preliminary data sheet version 2.1 electrical characteristics 14 - 6 micronas 14.3 dc characteristics table 14-3 dc characteristics parameter symbol limit values unit test condition min. max. supply currents digital supply current for 3.3 v domain i 3.3 v ? 150 ma all ports as inputs, f pixel = 50 mhz, 100 mhz bus configuration digital supply current for 2.5 v domain i 2.5 v ? 150 ma f pixel = 50 mhz, 100 mhz bus configuration analog power supply current i ana ? 100 ma ? idle mode supply current (with a/d wake up, rtc and external interrupts in active state) i idle ? 12 ma analog and digital supply sleep mode supply current (rtc running) i sleep ? 1.2 ma analog and digital supply power down mode supply current (rtc disabled) i pwdn ? 0.5 ma analog and digital supply i/o voltages (valid for any pin unless otherwise stated) input low voltage v il ? 0.4 0.8 v ? input high voltage v ih 2.0 3.6 v ? output low voltage v il ? 0.45 v ? output high voltage v ih 2.5 ? v ? leakage current i il ? 0.2 a @ 0.5 v < v in < ( v ihnom ? 0.5 v) output current i o ? 8ma ? crystal oscillator: xtal1(input), xtal2(output) amplifier transconductance ?? 4.2 ms ? oscillation frequency c fb 6.0 ? 50 ppm 6.0 + 50 ppm mhz ?
sda 6000 preliminary data sheet version 2.1 electrical characteristics 14 - 7 micronas duty cycle ? 45 55 % ? high time t h 50 ? ns ? pin capacitance (xtal1) c i ? 3.5 pf ? cvbs-input: cvbs1a (adc_diff = 0; differential cvbs input) pin capacitance c p ?? pf ? input impedance z p ?? 1/m ? ext. coupling capacitance c cpl1,2 10 100 nf ? source impedance ?? <500 ? overall cvbs amplitude v cvbs 0.75 1.3 v ? cvbs sync amplitude v sync 0.18 0.6 v ? txt data amplitude v data 0.3 0.7 v ? de-coupling capacitors to v dda at pins cvbsi c dec_cpl ?? nf ? cvbs-input: cvbs1a (adc_diff = 1; non-differential cvbs input) pin capacitance c p ?? pf ? input impedance z p ?? 1/m ? ext. coupling capacitance c cpl1 10 100 nf ? source impedance ? <500 ? overall cvbs amplitude v cvbs 0.75 1.3 v ? cvbs sync amplitude v sync 0.18 0.6 v ? txt data amplitude v data 0.3 0.7 v ? de-coupling capacitors to v dda at pins cvbsi c dec_cpl ?? nf ? cvbs-input: cvbs2 pin capacitance c p ?? pf ? input impedance z p ?? 1/m ? ext. coupling capacitance c cpl 10 100 nf ? source impedance ?? <500 ? overall cvbs amplitude v cvbs 0.75 1.3 v ? cvbs sync amplitude v sync 0.18 0.6 v ? table 14-3 dc characteristics (cont ? d) parameter symbol limit values unit test condition min. max.
sda 6000 preliminary data sheet version 2.1 electrical characteristics 14 - 8 micronas txt data amplitude v data 0.3 0.7 v ? de-coupling capacitors to v dda at pins cvbsi c dec_cpl ?? nf ? rgb-outputs load capacitance c p ? 20 pf ? output voltage swing v outpp 0.5 1.2 v available: 0.5 v; 0.7 v; 1.0 v; 1.2 v rgb offset u offset 0.27 0.33 v ? rise/fall times t rf 8.0 12.5 ns 8.0 ns (50 mhz output bw) 12.5ns (32mhz output bw) load resistance r l 10 ? k ? diff. non-linearity ?? 0.5 0.5 lsb ? int. non-linearity ?? 0.5 0.5 lsb ? output current tracking ?? 3% ? skew to cor, blank t skew ? 55 ns ? jitter to horizontal sync reference t jit ? 4ns ? address bits: a0 to a9, rd , csrom output rise time t r ? 16 ns (10% - 90%) output fall time t f ? 16 ns (10% - 90%) load capacitance c l ? 35 pf ? address bits: a10 to a15 output rise time t r ? 6 ns (10% - 90%) output fall time t f ? 6 ns (10% - 90%) load capacitance c l ? 35 pf ? p4.(0 .. 5) output rise time t r ? 16 ns (10% - 90%) output fall time t f ? 16 ns (10% - 90%) load capacitance c l ? 35 pf ? table 14-3 dc characteristics (cont ? d) parameter symbol limit values unit test condition min. max.
sda 6000 preliminary data sheet version 2.1 electrical characteristics 14 - 9 micronas data bits: d0 to d15 output rise time t r ? 6 ns (10% - 90%) output fall time t f ? 6 ns (10% - 90%) load capacitance c l ? 35 pf ? pin capacitance c i ? 5pf ? wr , cssdram , clken, ldqm, udqm output rise time t r ? 6 ns (10% - 90%) output fall time t f ? 6 ns (10% - 90%) load capacitance c l ? 35 pf ? pin capacitance c i ? 5pf ? memclk output rise time t r ? 2 ns (10% - 90%) output fall time t f ? 2 ns (10% - 90%) load capacitance c l ? 20 pf ? blank/corbla output rise time t r 8 12.5 ns (10% - 90%) output fall time t f 8 12.5 ns (10% - 90%) load capacitance c l ? 20 pf ? blank/corbla (control bit corbl = 0; blank only) output voltage no data insertion (video) v i-n 00.5v ? output voltage for data insertion v i-y 0.9 ? v ? blank/corbla (control bit corbl = 1; blank and cor) output voltage no data insertion no contrast reduction v ic-n 00.5v ? output voltage for contrast reduction and no data insertion v c-y 0.9 1.2 v ? table 14-3 dc characteristics (cont ? d) parameter symbol limit values unit test condition min. max.
sda 6000 preliminary data sheet version 2.1 electrical characteristics 14 - 10 micronas output voltage for data insertion v i-y 1.8 ? v ? hsync input rise time t r ? 100 ns (10% - 90%) input fall time t f ? 100 ns (10% - 90%) input hysteresis v hyst 300 600 mv ? input pulse width t ipwh 100 ? ns ? output pulse width t opwh 1us ? output rise time t r ? 100 ns (10% - 90%) output fall time t f ? 100 ns (10% - 90%) load capacitance c l ? 50 pf ? pin capacitance c i ? 5pf ? vsync input rise time t r ? 200 ns (10% - 90%) input fall time t f ? 200 ns (10% - 90%) input hysteresis v hyst 300 600 mv ? input pulse width t ipwv 2/fh ??? output pulse width t ipwv 1/ f h ? depends on register hpr output rise time t r ? 100 ns (10% - 90%) output fall time t f ? 100 ns (10% - 90%) load capacitance c l ? 50 pf ? pin capacitance c i ? 5pf ? vcs timing (master mode) pulse width of h-sync t hpvcs 4.59 s ? distance between equalizing impulses t dep 31.98 s ? pulse width of equalizing impulses t ep 2.31 s ? pulse width of field sync impulses t fsp 27.39 s ? table 14-3 dc characteristics (cont ? d) parameter symbol limit values unit test condition min. max.
sda 6000 preliminary data sheet version 2.1 electrical characteristics 14 - 11 micronas horizontal period t hpr ? s depends on register hpr p2.x, p3.x, p5.x, p6.x output rise time t r ? 25 ns (10% - 90%) output fall time t f ? 25 ns (10% - 90%) load capacitance c l ? 100 pf ? pin capacitance c i ? 10 pf ? input impedance (analog ports) z p ?? 1/m ? input sample frequency (general purpose ports) f s ? 33 mhz ? output current (p3.10, p3.14) i o ? 8ma ? hysteresis voltage (i 2 c inputs): p6.5, p6.6, p6.7, p3.0, p3.1) u hsyt ? 100 mv ? a/d converter characteristics (port 5.0 to p5.3) input voltage range v ain 02.5v ? adc resolution res 8 bit binary output during underflow ? 0 ?? output during overflow ? 255 ?? bandwidth ? 10.5 khz ? sampling time t s 2 s ? sampling frequency f sam 21 ? khz ? input source resistance r s ? 100 k ? pin capacitance (analog ports) c p ? 40 pf ? reset rstin pin capacitance c i ? 5pf ? reset in pull up resistor r pullup 47 100 k ? input high voltage u ih 2 ? v ? table 14-3 dc characteristics (cont ? d) parameter symbol limit values unit test condition min. max.
sda 6000 preliminary data sheet version 2.1 electrical characteristics 14 - 12 micronas 14.4 timings figure 14-1 h/v - sync-timing (sync-master mode) figure 14-2 vcs -timing (sync-master mode) uet11193 hsync vsync opwh t opwv t line i line i+1 line i+2 uet11194 cs v equalizing pulses field sync pulses equalizing pulses horizontal pulses equalizing pulses horizontal pulse field sync pulses v cs hpvcs t t hpr t hpr dep t ep t t t fsp hpr t hpvcs
sda 6000 preliminary data sheet version 2.1 electrical characteristics 14 - 13 micronas 14.5 package outlines p-mqfp-128-2 (plastic metric quad flat package) gpm09233 sorts of packing package outlines for tubes, trays etc. are contained in our data book ? package information ? . dimensions in mm smd = surface mounted device
sda 6000 preliminary data sheet version 2.1 electrical characteristics 14 - 14 micronas
all information and data contained in this data sheet are without any commitment, are not to be considered as an offer for conclusion of a contract, nor shall they be construed as to create any liability. any new issue of this data sheet invalidates previous issues. product availability and delivery are exclusively subject to our respective order confirmation form; the same applies to orders based on development samples deliv- ered. by this publication, micronas gmbh does not assume responsibil- ity for patent infringements or other rights of third parties which may result from its use. further, micronas gmbh reserves the right to revise this publication and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. no part of this publication may be reproduced, photocopied, stored on a retrieval system, or transmitted without the express written consent of micronas gmbh. sda 6000 4 6 m i c r onas micronas gmbh hans-bunte-strasse 19 d-79108 freiburg (germany) p.o. box 840 d-79008 freiburg (germany) tel. +49-761-517-0 fax +49-761-517-2174 e-mail: docservice@micronas.com internet: www.micronas.com printed in germany ord e r no. 6 25 1 -5 5 7 -1 pd


▲Up To Search▲   

 
Price & Availability of SDA6000

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X